Use the libraries and ORMs you already know. PGBox implements the standard PostgreSQL wire protocol with first-class support for Node.js, Python, Go, Rust, and standard SQL GUI tools.
Select your preferred language or framework to view connection snippets and JSON query patterns.
Official client SDKs for TypeScript, Python, Go, Rust, and Agent-Native Model Context Protocol (MCP).
import { pgb } from '@pgbox/client';
// 1. Typed Table Models (ORM & Query Paradigm)
const User = pgb.user;
const profile = await User.find({ id: '8ef5-492a-bb81' });
const user = await User.findOne({ email: 'sarah@resistance.ai' });
const created = await User.create({
name: 'Sarah Connor',
email: 'sarah@resistance.ai',
preferences: { theme: 'dark' }
});
// 2. Declarative Action Invocation: pgb.<actionName>(params)
const res = await pgb.saveOrder({
customer_id: user?.id,
total: 250.00
});
console.log(`Action status: ${res.status} (took ${res.duration_ms}ms)`);PGBox plays seamlessly with popular database toolkits. You can define schema-free JSON fields in your ORM models or execute raw parameterized SQL.
DATABASE_URL="postgresql://pgbox_app:pass@pg.pgboxhub.com/pgbox_db?sslmode=require"datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
data Json // Native JSONB document storage
createdAt DateTime @default(now())
}import { pgTable, text, jsonb, timestamp } from 'drizzle-orm/pg-core';
export const documents = pgTable('documents', {
id: text('id').primaryKey(),
payload: jsonb('payload').notNull(),
updatedAt: timestamp('updated_at').defaultNow(),
});// Accelerated query with Drizzle JSON operators
const results = await db.select().from(documents)
.where(sql`payload->>'status' = 'published'`);from sqlalchemy import create_engine, Column, String
from sqlalchemy.dialects.postgresql import JSONB
engine = create_engine("postgresql+psycopg://pgbox_app:pass@pg.pgboxhub.com/pgbox_db?sslmode=require")class Document(Base):
__tablename__ = "documents"
id = Column(String, primary_key=True)
attributes = Column(JSONB) # 100% GIN indexedSimply paste your public TLS connection string or input the host (`pg.pgboxhub.com`), database name, and credentials with SSL enabled (`Require`).
Provision databases, serverless compute, microVM containers, maps, auth, storage, and agent MCP tooling under one unified sovereign endpoint.