Ignore .js/.js.map/.d.ts/.d.ts.map next to sources (tsc outDir is dist). Preserve hand-written packages/auth/src/types/base58-universal.d.ts. Made-with: Cursor
@the-order/database
PostgreSQL database client and utilities for The Order.
Usage
import { getPool, query, healthCheck } from '@the-order/database';
// Initialize pool
const pool = getPool({
connectionString: process.env.DATABASE_URL,
max: 20,
});
// Execute query
const result = await query('SELECT * FROM users WHERE id = $1', [userId]);
// Health check
const isHealthy = await healthCheck();
Migrations
Migrations are handled by node-pg-migrate:
# Create a new migration
pnpm --filter @the-order/database migrate:create migration-name
# Run migrations
pnpm --filter @the-order/database migrate up
# Rollback migrations
pnpm --filter @the-order/database migrate down