SurrealDB Docs Logo

Enter a search query

.Export()

Export the database as a SurrealQL script. To use this method, you need to be connected to a SurrealDB instance that is version >= 2.1.0.

Method Syntax
await db.Export(options)

Arguments

ArgumentsDescription
options optional

Export configuration options.

cancellationToken optional

The cancellationToken enables graceful cancellation of asynchronous operations.

Example usage

Only exporting db functions in a schema variable
var options = new ExportOptions { Users = false, Accesses = false, Params = false, Functions = true, Users = false, Versions = false, Tables = false, Records = false, }; string schema = await db.Export(options);