Managed databases (PostgreSQL & MySQL)
5 min
Lunax provides native managed relational databases directly from your terminal. Rather than reselling third-party services, our platform provisions dedicated PostgreSQL 16 instances via CloudNativePG (and managed MySQL) on high-speed NVMe storage with synchronous HA standby.
Database status and quotas
Check your current database engine, provisioned environments, table count, and disk usage:
``bash
lunax db info
`
If no database has been attached to the linked project yet, the command displays your remaining account database quota and guides you on creation
Provisioning a managed database
Create an isolated database instance with dedicated dev and production credentials:
``bash
lunax db create --engine postgres --env both
This provisions dedicated database roles and namespaces, writes the connection strings securely into your site's encrypted environment variables (DATABASE_URL`), and configures network policies. The credentials are ready for Prisma Client, Drizzle, Django ORM, or Laravel.
Retrieving connection strings
To fetch your database credentials for external GUIs (such as TablePlus, DBeaver, or psql):
``bash
lunax db credentials
Displays host, port, username, password, and database name separately for dev and production` environments without writing plain secrets into your repository.
Inspecting schema and tables
View all tables, column types, row estimates, and disk footprint directly from the terminal:
``bash
lunax db inspect
Executing SQL queries
Run ad-hoc queries against your database securely:
``bash
lunax db query "SELECT count(*) FROM users;"
`
Outputs clean, formatted tabular data right in your terminal