Hiveku Database
A managed PostgreSQL database on Supabase, created in one click, with sign-in, file storage and automatic backups
Bring your own
A PostgreSQL database you already run, such as Supabase, Neon, PlanetScale or Railway, connected through
DATABASE_URLCreate a Hiveku Database
1
Open the Database tab
In the editor, click Database. A site without a database shows No Database Configured and two choices.
2
Create it
Under Create Hiveku Database, click Create Database. The button reads Creating… until the database is ready, and then the tab shows Database Connected.
3
Use it
There is nothing to copy. Hiveku saves the connection details as your site’s environment variables (listed below), and your code reads them.
Creating a database is a paid feature, and your plan sets how many databases your account can have. You need the Database permission (Websites › Database) to create one.
The variables it sets
Each one is also saved for Development and Production separately (for example
DATABASE_URL_DEV and DATABASE_URL_PROD). They point at the same database: a site has one database, shared by every branch and environment, unless you turn on database branching. See Environment Variables for how environment-specific variables work.
Connect Your Own Database
1
Copy the connection string
From your provider, copy the PostgreSQL connection string. Use its pooled connection if it offers one (Supabase and Neon both do): your site runs serverless, and every running copy opens its own connections.
2
Add it as DATABASE_URL
In the Database tab, click Add DATABASE_URL under Bring Your Own Database. Your site’s environment variables open in a new tab. Add
DATABASE_URL with the connection string and save. If you run Prisma migrations through a pooled connection, also add your provider’s direct connection as DIRECT_URL.3
Check it
Back in the Database tab, click Refresh. The tab shows Database Connected, with the type BYOD (External).
With your own database, you manage its backups, scaling and billing with your provider. The Auth, Storage and Functions tabs read the Supabase project behind a Hiveku Database. On your own database they show what they can read, or say why they can’t.
The Database Tab
Run SQL
Open the SQL tab, type a query and press ⌘+Enter (Ctrl+Enter on Windows). Try:CREATE TABLE, says Query executed successfully (no rows returned). To turn on a PostgreSQL extension, run CREATE EXTENSION "extension_name"; here. The Settings tab lists the extensions.
Let the AI create tables
You can also ask the AI in the editor to create or change tables, for example “Add a posts table with title, slug, content, author_id and published_at”. See Create Tables.Database Branching
With the Database Pro add-on, a site can have database branches, separate copies for its environments such asstaging. You can then try changes away from your live data.
- Turn it on: in the Overview tab, click Upgrade to Pro — $29/mo and confirm.
- Add a branch: type a name (for example
staging) and create it. Delete one from its row. - Turn it off: click Downgrade. Branching is turned off for this site and its branches are deleted. If no other site in your account uses Database Pro, the add-on is cancelled right away.
Use the Database in Code
DATABASE_URL is available to your server code once a database is connected.
- Prisma
- Drizzle
- Plain pg
In
prisma/schema.prisma, use the pooled connection for queries and the direct one for migrations:Backups
A Hiveku Database is backed up automatically. To see backups, make one before a risky change, or restore one, see Back Up Your Database.Troubleshooting
The tab says Connection Error
The tab says Connection Error
For a Hiveku Database, click Repair Connection. Hiveku finds the database’s correct address, resets its password and saves fresh connection variables. Your tables, rows and files are kept. Redeploy each environment afterwards: a deployed site keeps using the old password until it is deployed again.For your own database, check
DATABASE_URL on your site’s environment variables page. It must match your provider’s connection string exactly, and copy-paste slips are the most common cause.Creating a database says it is a paid feature
Creating a database says it is a paid feature
A Hiveku Database needs a paid plan, and each plan allows a set number of databases. Upgrade the plan, or connect your own database instead.
'Too many connections' errors
'Too many connections' errors
Each running copy of your site opens its own connections. Use a pooled connection string (a Hiveku Database’s
DATABASE_URL already is one), and create one database client per server instance rather than one per request.Prisma migrations hang or fail
Prisma migrations hang or fail
Migrations need a direct connection, not the pooled one. Set
directUrl = env("DIRECT_URL") in your Prisma schema, as above.My provider refuses the connection
My provider refuses the connection
Some providers only accept connections from addresses you list. Allow connections from anywhere, using SSL and a strong password.
I ran the wrong DROP TABLE
I ran the wrong DROP TABLE
Restore the most recent backup. See Back Up Your Database.
What’s Next?
Environment Variables
Manage secrets and settings for each environment
Create Tables
Design your schema by hand or with the AI