CREATE DATABASE

CREATE DATABASE#

Creates a virtual database backed by the connection to the system handling physical objects.

Syntax#

CREATE DATABASE database_name
[ WITH CONNECTION = [connection_name] ]
[ SOURCE DATABASE = [source_database_name] ]
[;]

Arguments#

database_name

Is the name of the new database. Database names must be unique within an instance of Querona and comply with the rules for identifiers.

[connection_name]

Is the name of the connection that virtual database will use to import metadata and materialize (cache) views if possible.

[source_database_name]

Is the name of the source database that will be used to import metadata from during database creation.

Examples#

  1. Create an empty virtual database using an existing connection.

CREATE DATABASE [MyDb] WITH CONNECTION = [myConnection];
  1. Create a virtual database using an existing connection and import metadata from existing virtual database.

CREATE DATABASE [MyNewSparkVdb]
  WITH CONNECTION = [Local Spark 2.3]
SOURCE DATABASE = [mysqlConnection]

See also#