After leaving, I built Typegres to fix the pain with a simpler approach I couldn't find elsewhere:
1. Define your schema: define your schema as TS classes
2. Express your data-model: add methods on those classes (encapsulation 101 applied to your database); this includes both computed columns and relations
3. Expose your API: explicitly mark members to expose
4. Use it (and this is the crazy part): Now the client (e.g., a web browser) can use your data-model directly to query data with SQL-level power (compiling into a single query) over RPC (securely!)
For a visual explanation and more details: https://typegres.com
New features in v0.3:
- SQLite support: complete codebase redo to support multiple dialects with high fidelity
- Live queries: subscribe to complex queries and get fresh results when underlying data changes
GitHub: https://github.com/ryanrasti/typegres Playground: https://typegres.com/play/