HCode runs PostgreSQL 16. Each database is its own server with its own database, user and password, reachable only from your project unless you turn on external access.
Names and credentials
HCode generates these when you create the database:
| Value | |
|---|---|
| Database | db_ followed by the name you typed, lowercased, with anything other than letters and digits turned into hyphens and cut to 48 characters. My App becomes db_my-app. |
| User | u followed by 8 random characters |
| Password | A random string starting with dbp_ |
| Host | db- followed by 12 random characters |
| Port | 5432 |
You can't choose them or change them. Copy them from the database's Internal connection box on the Databases page.
Connection string
The internal connection string looks like this:
postgres://u1a2b3c4d:dbp_xxxxxxxx@db-0a1b2c3d4e5f:5432/db_my-app?sslmode=disable
It ends in sslmode=disable because the connection stays inside your project's private network, where the database does not use TLS. Leave that part as it is.
Put the whole string in an environment variable such as DATABASE_URL. If your driver wants separate settings instead, take the user, password, host, port and database from it.
Memory and storage
A PostgreSQL database reserves 256 MB of memory and can use up to 512 MB. It also reserves 5 GB of storage. The memory reservation counts toward your plan while the database runs, and the data you store counts toward your storage. See Usage and limits.
Working with your data
- SQL editor: browse tables and run read-only queries in the dashboard.
- Import a database: load a
.sqlfile or apg_dumparchive. - External access: connect with
psqlor a desktop client from outside HCode.
Backups
PostgreSQL backups are taken with pg_dump, which reads one consistent snapshot of the database as of the moment the backup starts. Your app keeps running while it happens. Each backup is stored as a gzipped custom-format archive (.dump.gz).
See Scheduled backups for when they run and how long they are kept, and Restore a backup to roll the database back.