SurrealDB Docs Logo

Enter a search query

.RawQuery()

Runs a set of SurrealQL statements against the database, based on a raw SurrealQL query.

Method Syntax
db.RawQuery(sql string, vars map[string]interface{})

Arguments

ArgumentsDescription
sql required

Specifies the SurrealQL statements.

params optional

Assigns variables which can be used in the query.

Example usage

// Assign the variable on the connection vars := map[string]interface{}{"table": "person"} result, err := db.RawQuery("CREATE person; SELECT * FROM type::table($table);", vars)

On this page

© SurrealDB GitHub Discord Community Cloud Features Releases Install