Skip to content

Use implicit lifetime for query builder expr() arg#293

Open
dubrowgn wants to merge 1 commit intoIndra-db:mainfrom
dubrowgn:pr/query-expr-ref
Open

Use implicit lifetime for query builder expr() arg#293
dubrowgn wants to merge 1 commit intoIndra-db:mainfrom
dubrowgn:pr/query-expr-ref

Conversation

@dubrowgn
Copy link
Copy Markdown

@dubrowgn dubrowgn commented May 5, 2026

QueryBuilderImpl<'a>::expr improperly ties the lifetime of the expr argument to the lifetime of the QueryBuilderImpl instance, despite not accessing the argument outside the scope of the function. This makes using the API with non-static query expressions difficult/impossible.

Use an implicit lifetime for the expr argument, such that its lifetime is only tied to the duration of the function call.

fixes: #292

`QueryBuilderImpl<'a>::expr` improperly ties the lifetime of the `expr`
argument to the lifetime of the `QueryBuilderImpl` instance, despite not
accessing the argument outside the scope of the function. This makes
using the API with non-static query expressions difficult/impossible.

Use an implicit lifetime for the `expr` argument, such that its lifetime
is only tied to the duration of the function call.

fixes: Indra-db#292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improper QueryBuilderImpl::expr lifetime

1 participant