Skip to main content
db-common

Shared, tree-shakeable TypeScript database utilities for the @rtorcato/* family.

query.ts
import { paginate } from '@rtorcato/db-common'

const { limit, offset } = paginate({ page: 2, size: 25 })
// → { limit: 25, offset: 25 }
npm install @rtorcato/db-common
TypeScript-first
TypeScript-first
Strict types, generics preserved, JSDoc-rich in your IDE. Helpers that infer, not just accept `any`.
Tree-shakeable
Tree-shakeable
ESM-only with `sideEffects: false`. Bundlers keep just the helpers you import — nothing else ships.
Database-agnostic
Database-agnostic
Small primitives for query building, pagination, and result shaping — independent of any single driver.
Safe by default
Safe by default
Predictable return shapes and guarded edges. No surprise throws from the common path.

Sibling projects

More from @rtorcato — same conventions, same release pipeline.