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.
You can create databases for logical groupings for different teams or projects. For instance, you can create one 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's set as default automatically. If the name is case sensitive, you must wrap it in double quotes; otherwise the system uses the lowercase name.
Importantvirtual is a reserved database name. You cannot create it with this command.
Examples
Create a new database
The following shows how to create a new database. As this is the first database you're creating, DeltaStream automatically sets it as the default for the current organization and uses it for the remainder 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. As this is the first database you're creating, DeltaStream automatically sets it 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|+------------+-------------+------------+-------------------------------+