Make a database
A managed Postgres (reports/databases/README.md): a Drive (the data; in the strict tier unless storage.durability says standard: a commit returns once the object store has it) and an app of one stateful service whose instance mounts it, of the platform's Postgres image of the major version (ghcr.io/glacai/postgres-<version>), on the project's network under the database's name. The image makes the cluster on the empty Drive: the role group glac_superuser (the rights of Neon's neon_superuser; no superuser), the owner <database_name>_owner in it, the database; the owner's password is set once PostgreSQL is ready, as a SCRAM verifier, and is in this answer and kept nowhere. The call waits for the first start (150 s at the most) and answers the database ready (its instance's first start is over: PostgreSQL takes connections, the database is there, the owner has the password), or creating (it goes on: GET it). Idempotent by name: a create that names a database of the project answers that one, 200, without its password, where it asks for what it is. The app and the Drive are listed by /v1/apps and /v1/drives with managed_by, and changed through this API alone. A refusal of the Drive's or the app's create (the plan's limits, a name an app has) is the create's, and undoes what was made. Takes write. With tiering.enabled (a paid plan, where the object gateway serves), its branches load pg_lake and glac_tiering and run pgduck_server; where their partitions go and the key that reaches that prefix alone are handed to each running machine, never put in its start.
https://api.glac.ai/v1/databasesAuthorization
Request bodyJSONrequired
- sleep_after_secondsoptionalinteger | null
After how long with nothing asked of it its instance is paused, in seconds: from 1 (the default) to 3600 (an hour) on a paid plan. On Free 1, fixed: a Free plan's database is paused a second after its last query and sleeps five minutes later, as Neon's Free scales to zero; another value is refused 400
invalid_field.maximum: 3600 · minimum: 1 - suspend_after_secondsoptionalinteger | null
After how long paused its instance has its memory saved and sleeps, from 1 to 86400 (300, Neon's five minutes, where none is given): paused, it holds its sessions in memory and a connection is answered in a millisecond or two, its memory metered; asleep, only its storage is, and it still keeps its sessions. Its node holds it to the longest it holds any instance paused (ten minutes). On Free 300, fixed: another value is refused 400
invalid_field.maximum: 86400 · minimum: 1 - wake_daily_atoptionalstring | null
A time of day in UTC,
HH:MM, at which the database is woken every day while it rests, for what waits for a wake (pg_partman's maintenance, a vacuum that is due); it rests again once that is done. Itspg_cronjobs wake it at their own times whatever this says. Null (the default): none.pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$ - tieringoptionalobject | null
Tiered storage (DB18, Tiger's way): partitions of a table partitioned by range that a policy (
glac.add_tiering_policy) or a call (glac.tier_partition) moves become Parquet files in the platform's bucket of the project, still in the same table, read-only, read whereglac.enable_tiered_readsis on. On a paid plan alone (Free: 403paid_plan_required), where the object gateway serves (400objects_not_servedotherwise). Billed by their sizes before the move, $0.02 a GB-month (tiered_bytes); reading them is neither a request nor egress. - history_secondsoptionalinteger | null
How far back its root branch can be restored, or branched from, by a time, in seconds (slice DB8): a day unless the create said (
history_seconds), 0 (none) to 30 days on a paid plan, a day on Free (fixed, with a GB of old data at the most: its oldest versions go past it). The last day of it is its root branch's Drive's own window of versions, one every 30 seconds in which it was written (POST /v1/databases/{id}/branches/{branch}/restorewithat); further back, and to the second, is its WAL archive's (slice DB5:exact). Not billed: the history of a database's last day is free.maximum: 2592000 · minimum: 0
Returns
200
The database the name names, as the create asks for it: without its password.
- history_secondsintegerrequired
How far back its root branch can be restored, or branched from, by a time (slice DB8): a day unless the create said (
history_seconds), 0 (none) to 30 days on a paid plan, a day on Free (fixed, with a GB of old data at the most: its oldest versions go past it). The last day of it is its root branch's Drive's own window of versions, one every 30 seconds in which it was written (POST /v1/databases/{id}/branches/{branch}/restorewithat); further back, and to the second, is its WAL archive's (slice DB5:exact). Not billed: the history of a database's last day is free.maximum: 2592000 · minimum: 0
201
The database, ready (or creating, its first start under way), with the owner's password and the private connection string with it.
- history_secondsintegerrequired
How far back its root branch can be restored, or branched from, by a time (slice DB8): a day unless the create said (
history_seconds), 0 (none) to 30 days on a paid plan, a day on Free (fixed, with a GB of old data at the most: its oldest versions go past it). The last day of it is its root branch's Drive's own window of versions, one every 30 seconds in which it was written (POST /v1/databases/{id}/branches/{branch}/restorewithat); further back, and to the second, is its WAL archive's (slice DB5:exact). Not billed: the history of a database's last day is free.maximum: 2592000 · minimum: 0