| ▲ | Show HN: Typegres 0.3 – SQL-as-your-API, safely (using Cap'n Web RPC)(typegres.com) | |
| 3 points by ryanrasti 2 hours ago | ||
For three years I worked as CTO of a startup building a huge Postgres app (a WMS) from scratch. We had 100+ inter-related tables and the complexity of delivering feature after feature on this substrate nearly killed us (both the company and our sanity!) 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/ | ||