DEV Community

Neon-Nomad
Neon-Nomad

Posted on

Generate TypeScript + Zod types automatically from your Knex database

If you use Knex.js and TypeScript, you’ve probably fought the same problem I did:

your database schema, your types, and your runtime validation slowly drift apart.

So I built KnexBridge — a small CLI that introspects your database and generates
both TypeScript types and Zod schemas directly from it.


🚀 Quick Start

Install (no global deps needed):


bash
npx knexbridge generate
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
neonnomad profile image
Neon-Nomad

Thanks for checking this out! Would love feedback from anyone using Knex + TypeScript especially around PostgreSQL setups.