# Export

Export the database as a SurrealQL script.

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`.

```csharp title="Method Syntax"
await db.Export(options)
```

## Arguments

<table>
    <thead>
        <tr>
            <th colspan="2" scope="col">Arguments</th>
            <th colspan="2" scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>options</code>
                <label label="optional" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                Export configuration options.
            </td>
        </tr>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>cancellationToken</code>
                <label label="optional" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                The cancellationToken enables graceful cancellation of asynchronous operations.
            </td>
        </tr>
    </tbody>
</table>

## Example usage

```csharp title="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);
```
