Every app I've built required the core data model to be rephrased four times: schema, ORM, controller, DTO. The "API" layer was just translation between them. I wanted clients to compose against the schema directly, without coupling the public API to it. What I found: - Prisma / Drizzle provide an ORM (but are server-only and still require a controller + DTO) - PostgREST / Hasura / PostGraphile auto-expose the schema (but at the cost of tight coupling and without a first-class way to express complex logic) - GraphQL removes nesting boilerplate (but clients don't have rich operators: filtering, aggregation, raw joins) With Typegres: 1. Postgres tables become TypeScript classes, methods compile to the SQL you'd expect, and the underlying schema is yours to refactor. 2. Clients compose typed queries against the methods you choose to expose. Sandboxed via object-capability-based RPC. 3. `.live()` allows clients to subscribe to a query and get fresh results when underlying data changes. Try it in your browser: https://typegres.com/play Code: https://github.com/ryanrasti/typegres Developer preview. Genuinely interested to see if this solves problems you've had. |