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
Inflexible sdks.
The query method allows the execution of arbitrary SQL at the expense of a typed return, and the select method is extremely rigid in what it does but it does have a typed return.
Describe the solution
Query builder like syntax to combine the best of both worlds.
Nothing needs to change on what is there already, but new methods could be added that can be chained together to build a query and then completed with a call to a particular method such as fetch.
let res Vec<Model> = db.from('table').filter('column', 'eq', 'value').order_by('column2').limit(10).fetch().await?
I'm not entirely sure, but potentially fetch could even discern the SELECT portion of the statement from they type its returning? Potentially through something like fetch<Model>()?
Alternative methods
Only alternatives are query for EVERYTHING or handle the generic surrealdb::Response from query with let created: Option<Person> = result.take(0)?; off of query result which is a good way to do it, but the potential for a set of simple query builder methods is more succinct
Is your feature request related to a problem?
Inflexible sdks.
The query method allows the execution of arbitrary SQL at the expense of a typed return, and the select method is extremely rigid in what it does but it does have a typed return.
Describe the solution
Query builder like syntax to combine the best of both worlds.
Nothing needs to change on what is there already, but new methods could be added that can be chained together to build a query and then completed with a call to a particular method such as
fetch
.I'm not entirely sure, but potentially
fetch
could even discern theSELECT
portion of the statement from they type its returning? Potentially through something likefetch<Model>()
?Alternative methods
Only alternatives are query for EVERYTHING or handle the generic
surrealdb::Response
fromquery
withlet created: Option<Person> = result.take(0)?;
off of query result which is a good way to do it, but the potential for a set of simple query builder methods is more succinctSurrealDB version
1.4.2 for macos on aarch64
Contact Details
[email protected]
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: