Similar to other relational databases, a Database is a logical grouping of Schemas in DeltaStream. Databases are the foundation for organizing data in DeltaStream and provide the building block of its namespacing model. Users can create databases for logical groupings for different teams or projects. For instance, you can create a Database for a logging project and another for an ads team.
Arguments
database_name
Name of the Database to create. When a Database is created, it automatically includes a public schema in the Database. If the new Database is the only Database in the organization, it will be set as default automatically. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.
virtual is a reserved Database name and cannot be created with this command.
Examples
Create a new Database
The following shows how to create a new Database. Note that since we are creating the first Database, it is automatically set as the default for current Organization and used for the rest of the session:
<no-db>/<no-store># CREATE DATABASE demodb;+------------+---------------+------------+------------------------------------------+|Type|Name|Command|Summary|+============+===============+============+==========================================+|database|demodb|CREATE|database"demodb"wassuccessfully|||||created|+------------+---------------+------------+------------------------------------------+|schema|demodb.public|CREATE|schema"demodb.public"wassuccessfully|||||created|+------------+---------------+------------+------------------------------------------+demodb.public/<no-store># LIST DATABASES;+-------------+-------------+------------+-------------------------------+|Name|IsDefault|Owner|CreatedAt|+=============+=============+============+===============================+|demodeb|true|sysadmin|2024-07-0221:41:40+0000UTC|+-------------+-------------+------------+-------------------------------+
Create a new case-sensitive Database
The following shows how to create a new Database. Note that since we are creating the first Database, it is automatically set as the default for the user account:
<no-db>/<no-store># CREATE DATABASE "DemoDB!";+------------+----------------+------------+------------------------------------------+|Type|Name|Command|Summary|+============+================+============+==========================================+|database|DemoDB!|CREATE|database"DemoDB!"wassuccessfully|||||created|+------------+----------------+------------+------------------------------------------+|schema|DemoDB!.public|CREATE|schema"DemoDB!.public"was|||||successfullycreated|+------------+----------------+------------+------------------------------------------+DemoDB!.public/<no-store># LIST DATABASES;+------------+-------------+------------+-------------------------------+|Name|IsDefault|Owner|CreatedAt|+============+=============+============+===============================++------------+-------------+------------+-------------------------------+|DemoDB!|true|sysadmin|2024-07-0216:24:11+0000UTC|+------------+-------------+------------+-------------------------------+