Connecting
Connect to ScalixNova with any standard PostgreSQL driver — psql, node-postgres, psycopg, Prisma, Drizzle
It's just Postgres
ScalixNova speaks the native PostgreSQL wire protocol, so you connect with the
driver and tools you already use — psql, node-postgres (pg), psycopg,
Prisma, Drizzle, SQLAlchemy, or anything else that speaks Postgres. There is no
proprietary database driver to install.
Use a standard driver for running SQL (the data plane). For control-plane operations — creating branches, point-in-time restores, and provisioning — use the CLI, the SDK, or the API.
Get your connection string
Every database has a ready-made connection string. Get yours from:
- Console → your project → Database → Connect, or
- the
connection_stringfield returned when you create a database via the CLI or API.
It looks like this:
postgresql://t_a1b2c3d4e5f6:YOUR_API_KEY@db.scalix.world:6432/db_a1b2c3d4e5f6?sslmode=requireReplace YOUR_API_KEY with a Scalix API key.
Then store the whole string as an environment variable:
export DATABASE_URL="postgresql://t_a1b2c3d4e5f6:scalix_sk_...@db.scalix.world:6432/db_a1b2c3d4e5f6?sslmode=require"Anatomy
| Part | Value | Notes |
|---|---|---|
| User | t_… | Your database's dedicated NOSUPERUSER role — assigned automatically. |
| Password | your API key | Use a Scalix API key as the password. Scope and rotate it like any key. |
| Host / Port | db.scalix.world:6432 | The managed endpoint. Copy the exact host/port from your connection string. |
| Database | db_… | Your isolated database — assigned automatically. |
sslmode=require | required | TLS is mandatory. Connections without TLS are rejected. |
Connect
All examples assume DATABASE_URL is set as above.
psql
psql "$DATABASE_URL"Node.js — node-postgres (pg)
import { Pool } from 'pg'
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
const { rows } = await pool.query('SELECT now()')
console.log(rows[0])Python — psycopg
import os
import psycopg
with psycopg.connect(os.environ["DATABASE_URL"]) as conn:
with conn.cursor() as cur:
cur.execute("SELECT now()")
print(cur.fetchone())Prisma
// schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Drizzle
import { drizzle } from 'drizzle-orm/node-postgres'
import { Pool } from 'pg'
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
export const db = drizzle(pool)TLS is required
ScalixNova rejects plaintext connections — every client must use TLS
(sslmode=require or stronger). Most drivers negotiate this automatically when
sslmode=require is in the connection string. The password is only sent after the
TLS handshake completes.
For stricter verification, use sslmode=verify-full with your system CA bundle.
Connection pooling
Pooling is built in at the gateway — you don't need PgBouncer or an external pooler. Point your client at the connection string above and open connections normally; the platform multiplexes them for you.
Prefer HTTP?
If you'd rather not manage a TCP connection — for example, from a serverless function or an AI agent — run SQL over HTTPS with the SDK:
import { executeSql } from "@scalix-world/sdk"
const { data, error } = await executeSql({
headers: { Authorization: `Bearer ${process.env.SCALIX_API_KEY}` },
body: { query: "SELECT now()" },
})
console.log(data?.rows)