CREATE DATABASE#
Creates a virtual database backed by the connection to the system handling physical objects.
Syntax#
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 views if possible.
source_database_name
Is the name of the source database that will be used to import metadata from during database creation.
Permissions#
Requires CREATE DATABASE permission, and CONTROL permission on the connection named in connection_name. Being able to create databases does not by itself say which connections you may put them on, so a login that can only view a connection cannot create a database that runs over it.
Examples#
Create an empty virtual database using an existing connection.
CREATE DATABASE [MyDb] WITH CONNECTION = [myConnection];
Create a virtual database using an existing connection and import metadata from existing virtual database.
CREATE DATABASE [MyNewSparkVdb]
WITH CONNECTION = [Local Spark 3.0]
SOURCE DATABASE = [mysqlConnection]