new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Drizzle ORM · all subjects

cockroachdb/connections

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Basic CockroachDB connection with node-postgres

Example of basic CockroachDB connection: ```typescript import { drizzle } from 'drizzle-orm/cockroach'; const db = drizzle(process.env.DATABASE_URL); const result = await db.execute('select 1'); ```

CockroachDB connection with config object

Example of CockroachDB connection with configuration: ```typescript import { drizzle } from 'drizzle-orm/cockroach'; const db = drizzle({ connection: { connectionString: process.env.DATABASE_URL, ssl: true } }); const result = await db.execute('select 1'); ```

CockroachDB connection with existing Pool

Example of CockroachDB connection with an existing node-postgres Pool: ```typescript import { drizzle } from 'drizzle-orm/cockroach'; import { Pool } from 'pg'; const pool = new Pool({ connectionString: process.env.DATABASE_URL, }); const db = drizzle({ client: pool }); const result = await db.execute('select 1'); ```

CockroachDB supported drivers

Drizzle ORM has native support for CockroachDB connections with the node-postgres and postgres.js drivers.

Install postgres package for Nile connection

To connect Drizzle ORM to Nile, install the 'pg' package and '@types/pg' as a dev dependency.

Neon database connection string format

Neon database connection strings follow the format: postgres://username:password@ep-cool-darkness-123456.us-east-2.aws.neon.tech/neondb?sslmode=require. Copy your connection string from the Neon Console Project Dashboard and set it as the DATABASE_URL environment variable.

Railway PostgreSQL connection URLs

Railway provides two database connection URL types: a public URL (accessible from anywhere, uses TCP proxy, format postgresql://postgres:password@region.railway.app:port/railway) for local development, and a private URL (*.railway.internal hostname, only accessible from services within the same Railway project) for service-to-service communication. For local drizzle-kit operations, use the public URL.

Give your agent this brain