logoalt Hacker News

loboftayesterday at 5:15 PM1 replyview on HN

As far as I understand Acadia gives you Acadia <-> Native class data sync, only just Haskell and Elm at the moment unfortunately.

I'd be willing to rewrite queries in some other language that transpiles to SQL if it allows me to do all the queries I want and gives me full compile time type support for db access in return.

The policies look interesting too by the way, but they don't solve a major IMO.


Replies

ryanrastiyesterday at 9:57 PM

> I'd be willing to rewrite queries in some other language that transpiles to SQL if it allows me to do all the queries I want and gives me full compile time type support for db access in return.

Full typed coverage for db is what I'm doing in Typegres [1] -- including all dialect built-in functions/operators.

And regarding policy, instead of RLS it's all based on ocap: reachability is permission. So: `api.user.posts()` automatically injects a `where` clause on the `users` table and it's composable wherever a SQL set expression is allowed: `api.user.posts().join(...).groupBy(...)`. Since we're building up a SQL expression tree, we avoid the N+1 problem entirely.

[1] https://typegres.com/