Expand description
Database lifecycle helpers: CREATE DATABASE / DROP DATABASE against a
maintenance connection. Useful for test scaffolding and dev tooling where
you don’t want a separate psql dependency.
Connects to the postgres maintenance database on the same host/port, so
the target database doesn’t have to exist yet.
Functions§
- create_
database - Create
databaseif it does not already exist. Returnstrueif a new database was created,falseif it was already present. - drop_
database - Drop
database. Withforce, first terminates other sessions connected to the target so the DROP can proceed. Succeeds silently if the database does not exist.