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
It would be useful if you could provide some examples in the readme for how to use each function - both when passing structs and map/surrealdb.O, as well as if we want to receive/store the result or not.
For example, I'm having trouble using the Insert command/function. In particular, it seems that we must provide a result struct for TResult. But I dont want to receive any result - I just want it to insert and return any error that might happen.
It seems like I have to do something like
type InsertResult struct {
}
if _, err := surrealdb.Insert[InsertResult](d.db, models.Table(tableName), payloads); err != nil {
Is there any way to avoid this, for simplicity?
Perhaps more importantly, how do we use these functions when we have a schemaless table? It is hard to provide a schema/struct if a table is schemaless/of unknown schema
Should we be just providing an empty interface, like this?
Description
It would be useful if you could provide some examples in the readme for how to use each function - both when passing structs and map/surrealdb.O, as well as if we want to receive/store the result or not.
For example, I'm having trouble using the
Insert
command/function. In particular, it seems that we must provide a result struct for TResult. But I dont want to receive any result - I just want it to insert and return any error that might happen.It seems like I have to do something like
Is there any way to avoid this, for simplicity?
Perhaps more importantly, how do we use these functions when we have a schemaless table? It is hard to provide a schema/struct if a table is schemaless/of unknown schema
Should we be just providing an empty interface, like this?
If so, it seems like there must be a way to make this cleaner/simpler.
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: