.RawQuery()
Runs a set of SurrealQL statements against the database, based on a raw SurrealQL query.
Method Syntaxdb.RawQuery(sql string, vars map[string]interface{})
Arguments | Description | ||
---|---|---|---|
sql required | Specifies the SurrealQL statements. | ||
params optional | Assigns variables which can be used in the query. |
// Assign the variable on the connection vars := map[string]interface{}{"table": "person"} result, err := db.RawQuery("CREATE person; SELECT * FROM type::table($table);", vars)