Zapatos
Zero-abstraction Postgres for TypeScript: a non-ORM database library
README
For details and documentation, see https://jawj.github.io/zapatos/
Zapatos:
Zero-Abstraction Postgres for TypeScript
Postgres and TypeScript are each, individually, fabulous.
Zapatos aims to make them work beautifully together. No abstractions, no distractions: just your database, with type safety.
OK just ran the sample on my own schema, whoa, this is fire.
mrjjwright, GitHub
What does it do?
To achieve this aim, Zapatos does these five things:
- Typescript schema
A command-line tool speaks to your Postgres database and writes up a detailed TypeScript schema for every table. This is just a means to an end: it enables the next three things in this list. Show me »
- Arbitrary SQL
Simple building blocks help you write arbitrary SQL using tagged templates, and manually apply the right types to what goes in and what comes back. Show me »
- Everyday CRUD
Shortcut functions produce everyday CRUD queries with no fuss and no surprises, fully and automatically typed. Show me »
- JOINs as nested JSON
Nested shortcut calls generate LATERAL JOIN queries, resulting in arbitrarily complex nested JSON structures, still fully and automatically typed. Show me »
- Transactions
Transaction helper functions assist in managing and retrying transactions.