ORMs
Use Prisma, Drizzle, Kysely, TypeORM, or Sequelize with Silos — configured as a standard PostgreSQL database.
Silos works with PostgreSQL ORMs because it speaks the standard Postgres wire
protocol and runs a real Postgres engine. You configure your ORM exactly as you
would for any Postgres database: set the connection string, require SSL, and use the
postgres dialect.
Each ORM below connects to Silos as a standard PostgreSQL database. We haven't published per-ORM integration tests, so treat these as "configured like any Postgres," not as bespoke, ORM-specific integrations. If you find a rough edge, let us know.
Configure
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}DATABASE_URL="postgres://user:password@db-xxxx.silos.sh/main?sslmode=require"Use the postgresql provider and point url at your Silos connection string.
sslmode=require in the URL keeps the connection encrypted.
import { drizzle } from 'drizzle-orm/node-postgres'
import { Pool } from 'pg'
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: true },
})
export const db = drizzle(pool)Drizzle's node-postgres adapter takes an ordinary pg pool. Point it at your
Silos connection string and it behaves like any Postgres connection.
import { Kysely, PostgresDialect } from 'kysely'
import { Pool } from 'pg'
export const db = new Kysely<Database>({
dialect: new PostgresDialect({
pool: new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: true },
}),
}),
})Kysely's PostgresDialect wraps a pg pool — the same pattern you'd use against any
Postgres server.
import { DataSource } from 'typeorm'
export const AppDataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: true },
entities: [/* ... */],
})Set type: 'postgres' and pass your Silos connection string as url.
import { Sequelize } from 'sequelize'
export const sequelize = new Sequelize(process.env.DATABASE_URL!, {
dialect: 'postgres',
dialectOptions: {
ssl: { require: true, rejectUnauthorized: true },
},
})Use the postgres dialect and enable SSL in dialectOptions.
Migrations
Your ORM's migration tooling runs ordinary DDL against Silos, so schema migrations work as usual. For latency-sensitive setups, run migrations against a database that's already warm, since the first statement after an idle period pays the cold-start cost — see Scale to zero.
You can also branch a database before a migration to test it in isolation, then apply it to the primary once it's verified — see Branch connections.