On this page
Status: Supported. Source: crates/network/src/server/registry.rs, crates/sql/src/parser/use_.rs, crates/executor/src/executor.rs:execute_show.
Concepts#
- A database is an isolated storage root. Database
plomidlives directly in the data dir; every other database lives in<data_dir>/databases/<name>/with its own engine + WAL. - A schema is a namespace inside a database (
publicby default).search_pathcontrols unqualified name resolution. - Database names must match
[_A-Za-z][_A-Za-z0-9]*(safe_database_name).
Steps#
CREATE DATABASE shop;
USE shop; -- switch session database
CREATE SCHEMA analytics;
SET search_path TO analytics, public;
SHOW databases; -- also: SHOW database | SHOW schemas | SHOW tablesVia the wire protocol, connect with database=shop in the startup message (psql "postgresql://plomid:secret@localhost:5432/shop").
Behavior#
CREATE DATABASEforplomiduses the shared engine; other names open an isolatedPlomidStorageEnginerooted at their own path.USE <db>switches the session's database context; unknown names error.SHOW tableslists the current database's tables.
Constraints#
CREATE/DROP DATABASE,USE,SHOW DATABASESare handled by the database registry layer, not the generic executor path.- No
RENAME DATABASEin v0.1.0.
Next#
Was this page helpful? Thanks — noted locally, nothing is sent anywhere.