postgresdk is a code generation tool that produces a typed server/client SDK from a PostgreSQL database schema. At version 0.19.6 (under active development, not stable for production), it generates TypeScript types, Zod runtime validation, and a Hono server router with full CRUD, relationship loading, filtering, transactions, and built-in auth. Key differentiators: schema-driven generation eliminates boilerplate; includes pgvector vector search support; output is ESM-only with good tree-shaking. Release cadence is irregular (pre-v1). Alternative to Prisma, Drizzle ORM, or tRPC-style approaches.
npm install postgresdkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up a Hono server using the generated createRouter and use the client SDK to perform CRUD operations with relationship loading.
Use `import { SDK } from './api/client'`.Install Hono: `npm install hono` or `bun add hono`.
Use `npx postgresdk` or install as a devDependency and run via npm scripts.
Update import paths from `./generated/server/router` to `./api/server/router`.
Run `npx postgresdk generate --config postgresdk.config.ts` or ensure config file exists at project root.
Change import path from `./generated/server/router` to `./api/server/router`.
Ensure you use `import { SDK } from './api/client'` and instantiate with `new SDK({ baseUrl: '...' })`.Run `npm install hono` or `bun add hono`.
Run `npx postgresdk init` to generate a config file, or create one manually.