CREATE DATABASE

Syntax

CREATE DATABASE database_name;

Description

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 the user account:

<no-db>/demostore# CREATE DATABASE demodb;
demodb.public/demostore# LIST DATABASES;
   Name  | Default |  Owner   |      Created at      |      Updated at
---------+---------+----------+----------------------+-----------------------
  demodb |        | sysadmin | 2022-08-22T17:01:02Z | 2022-08-22T17:01:02Z

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>/demostore# CREATE DATABASE "DemoDB!";
demodb.public/demostore# LIST DATABASES;
   Name   | Default |  Owner   |      Created at      |      Updated at
----------+---------+----------+----------------------+-----------------------
  DemoDB! |        | sysadmin | 2022-08-22T17:01:02Z | 2022-08-22T17:01:02Z

Last updated