CREATE DATABASE

Creates a virtual database. It is a much simpler statement then in SQL Server because no storage or transaction options are needed.

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 Lyftron 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 (cache) is possible.

[source_database_name]

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

Examples

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

CREATE DATABASE [MyDb] WITH CONNECTION = [myConnection];

B. 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]