Files
the_order/packages/database
defiQUG 3f7cc0f854 feat(finance): BTC basket flows, client scoping, and jewelry-box store
- Finance API: baskets, holdings, rebalances, deposits, bridge withdrawals, vault checks.
- Schemas: btc-basket; api-client finance types; workspace lockfile update.
- Vitest config for finance service; expanded tests.

Made-with: Cursor
2026-04-07 22:59:32 -07:00
..

@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