Skip to main content
Version: 2.x(alpha)

Import command

The ML import command is used to import a new machine learning model into SurrealDB.

BEFORE YOU START : Make sure you’ve installed SurrealDB — it should only take a second!

Command arguments

ArgumentsDescription
-e, --endpoint / --connOPTIONAL

Sets the url of the database server to connect to

-u / --userREQUIRED

Sets master username for the database

-p / --passREQUIRED

Sets master password for the database

--nsREQUIRED

Sets the desired namespace in which to import data

--dbREQUIRED

Sets the desired database into which to import data

Positional argument

ArgumentsDescription
fileREQUIRED

Sets the the path to the file which should be imported

Example usage

To perform a SurrealQL database import from a local file, in a terminal run the surreal import command with the required arguments.

surreal ml import --conn http://localhost:8000 --user root --pass root --ns test --db test my-surrealml-model.surml

Command help

To see the help information and usage instructions, in a terminal run the surreal ml import --help command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the ml import command.

surreal ml import --help

The output of the above command :

Import a SurrealML model into an existing database

Usage: surreal ml import [OPTIONS] --namespace <NAMESPACE> --database <DATABASE> <FILE>

Arguments:
<FILE> Path to the SurrealML file to import

Options:
-e, --endpoint <ENDPOINT> Remote database server url to connect to [default: ws://localhost:8000] [aliases: conn]
-u, --username <USERNAME> Database authentication username to use when connecting [env: SURREAL_USER=] [aliases: user]
-p, --password <PASSWORD> Database authentication password to use when connecting [env: SURREAL_PASS=] [aliases: pass]
--auth-level <AUTH_LEVEL> Authentication level to use when connecting
Must be enabled in the server and uses the values of '--namespace' and '--database'
[env: SURREAL_AUTH_LEVEL=] [default: root] [possible values: root, namespace, ns, database, db]
--namespace <NAMESPACE> The namespace selected for the operation [env: SURREAL_NAMESPACE=] [aliases: ns]
--database <DATABASE> The database selected for the operation [env: SURREAL_DATABASE=] [aliases: db]
-h, --help Print help