Databases¶
A database is a Postgres copy of tables you pick from your data, kept up to date on a schedule. Connect Power BI, a notebook, or your own application to it with normal Postgres credentials.
The copy is one-way. Custodea writes into the database; nothing you change in it flows back.
Add a database¶
Go to Dashboard → Databases and click Add database. Give it a name and choose how often it refreshes: every hour, every day, or every week. The database is set up in the background; the row shows Active when it is ready.
Adding, changing, and deleting a database requires the administrator or owner role. Members can see the list.
Choose tables¶
Open Details on a database and tick the tables to copy, then Save tables. The list is your catalog, with the current row count per table. Tables appear in the database under the same name as in the catalog.
Each refresh copies every selected table in full: it builds a fresh copy next to the current one, then swaps the two in a single transaction. A query running during a refresh sees either the old table or the new one, never a half-written one.
Two consequences of the full copy:
- Anything you create on top of a copied table, such as a view, an index, or a grant, is dropped with the old table at the next refresh. Keep your own objects in their own tables.
- Columns holding nested data (lists or records) are written as text
containing JSON. Cast with
::jsonbwhen you need the structure.
A table you remove from the selection stops being refreshed, but the copy already in the database is left in place.
Refresh¶
The schedule runs on its own. Refresh now starts a run straight away; after a successful refresh it can be used once every 24 hours, before the first successful refresh once every 15 minutes.
The Last refresh column shows the outcome. If one table failed, the run is marked Some tables failed and the reason is shown next to that table under Details; the other tables are still refreshed.
Pause stops the schedule; Resume starts it again. A paused database still answers queries.
Connect¶
Under Details → Connect, click Show connection details to see the
host, port, database name, user, and password, with a ready-made psql
line. Every time the password is shown, an entry is written to your
organisation's audit log.
The credentials give full access to the database, so treat them as you would any production database password.
TLS is required. Use sslmode=require or stricter.
The database goes to sleep after a period without connections. The first query after that can take a few seconds while it wakes; later queries run at normal speed.
Delete¶
Delete removes the database from the list and stops its refreshes. It is kept for 14 days and then removed permanently. Deleting a database never touches your data in Custodea: a new database with the same tables can be created and refreshed at any time.