• Start

Languages

/

.NET

/

Methods

Import

The .NET SDK for SurrealDB enables simple and advanced querying of a remote or embedded database.

Imports data into a SurrealDB database.
To use this method, you need to be connected to a SurrealDB instance that is version >= 2.0.0.

Method Syntax
await db.Import(string)

Arguments

Description

input

The SurrealQL script used to import data in the database.

cancellationToken

The cancellationToken enables graceful cancellation of asynchronous operations.

string input = 
        """
        DEFINE TABLE foo SCHEMALESS;
        DEFINE TABLE bar SCHEMALESS;
        CREATE foo:1 CONTENT { hello: "world" };
        CREATE bar:1 CONTENT { hello: "world" };
        DEFINE FUNCTION fn::foo() {
            RETURN "bar";
        };
        """;

await db.Import(input);

Was this page helpful?