ScalixScalix Docs

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 usepsql, 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 → DatabaseConnect, or
  • the connection_string field returned when you create a database via the CLI or API.

It looks like this:

text
postgresql://t_a1b2c3d4e5f6:YOUR_API_KEY@db.scalix.world:6432/db_a1b2c3d4e5f6?sslmode=require

Replace YOUR_API_KEY with a Scalix API key. Then store the whole string as an environment variable:

bash
export DATABASE_URL="postgresql://t_a1b2c3d4e5f6:scalix_sk_...@db.scalix.world:6432/db_a1b2c3d4e5f6?sslmode=require"

Anatomy

PartValueNotes
Usert_…Your database's dedicated NOSUPERUSER role — assigned automatically.
Passwordyour API keyUse a Scalix API key as the password. Scope and rotate it like any key.
Host / Portdb.scalix.world:6432The managed endpoint. Copy the exact host/port from your connection string.
Databasedb_…Your isolated database — assigned automatically.
sslmode=requirerequiredTLS is mandatory. Connections without TLS are rejected.

Connect

All examples assume DATABASE_URL is set as above.

psql

bash
psql "$DATABASE_URL"

Node.js — node-postgres (pg)

javascript
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

python
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

prisma
// schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Drizzle

typescript
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:

typescript
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)

Next steps