.Query()
Runs a set of SurrealQL statements against the database.
Method Syntaxdb.Query[TResult any](sql string, vars map[string]interface{}) (*[]QueryResult[TResult], error)
Arguments | Description | ||
---|---|---|---|
sql required | Specifies the SurrealQL statements. | ||
vars optional | Assigns the value to the variable name. |
result, err := db.Query("SELECT * FROM type::table($tb)", map[string]interface{}{"tb": "person"})