You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnget_users(database:Database) -> Result<implStream<Item = Result<ConceptMap>>>{Session::new(database,Data).await?
.transaction(TransactionType::Read).await?
.query().match_("match $x isa user;")}
This compiles and correctly returns the match query stream. However, as soon as we exit the scope of the function, the transaction is dropped and closed, and the stream is closed immediately, returning no items. This behaviour is confusing.
Proposed Solution
Query and concept streams should be bound by the lifetime of the transaction (/ query manager / concept manager). In that case, the above snippet will not compile, forcing the user to either hold on to the session and transaction handles, or retrieve all the data up front.
The text was updated successfully, but these errors were encountered:
…hecks (#515)
## What is the goal of this PR?
We improve the UX of Driver usage in several ways:
- [Rust/Java/Python] Fix the formatting of error messages received from
the server during a transaction.
- [Java] Fix native error message formatting.
- [Java/Python] Add the ability to enable Rust logging over FFI
(resolves#482).
- The granularity of the logs is controlled by the
`TYPEDB_DRIVER_LOG_LEVEL` environment variable, which can be set to any
value of `error` (default), `warn`, `info`, `debug`, or `trace`, in
order of increasing verbosity. Setting the value to
`"typedb_driver=info"` will show only the typedb-driver messages.
- More advanced syntax is described in [the env_logger
documentation](https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging)
- [Rust] Network streams now borrow the transaction, so that the
transaction can't be mistakenly dropped. (resolves#449)
…hecks (typedb#515)
## What is the goal of this PR?
We improve the UX of Driver usage in several ways:
- [Rust/Java/Python] Fix the formatting of error messages received from
the server during a transaction.
- [Java] Fix native error message formatting.
- [Java/Python] Add the ability to enable Rust logging over FFI
(resolvestypedb#482).
- The granularity of the logs is controlled by the
`TYPEDB_DRIVER_LOG_LEVEL` environment variable, which can be set to any
value of `error` (default), `warn`, `info`, `debug`, or `trace`, in
order of increasing verbosity. Setting the value to
`"typedb_driver=info"` will show only the typedb-driver messages.
- More advanced syntax is described in [the env_logger
documentation](https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging)
- [Rust] Network streams now borrow the transaction, so that the
transaction can't be mistakenly dropped. (resolvestypedb#449)
Problem to Solve
Currently it is possible to write this:
This compiles and correctly returns the match query stream. However, as soon as we exit the scope of the function, the transaction is dropped and closed, and the stream is closed immediately, returning no items. This behaviour is confusing.
Proposed Solution
Query and concept streams should be bound by the lifetime of the transaction (/ query manager / concept manager). In that case, the above snippet will not compile, forcing the user to either hold on to the session and transaction handles, or retrieve all the data up front.
The text was updated successfully, but these errors were encountered: