logoalt Hacker News

ryanrastiyesterday at 10:48 PM0 repliesview on HN

> "code can only take actions via the references it has been passed"

The cool part is a move to capabilities composed in code brings back everything great about software itself: composability, encapsulation, type systems.

I've been working on this for SQL: instead of giving clients a handle to endpoints, you give them scoped query builders they can compose with (e.g., hand out a scoped `users` object and client can do `users.where(u => u.isActive()).orderBy(u => u.createdAt)`).

The result is you define a data-model (schema, computed columns, relations) and expose that instead of an endpoint per desired client query.

(if interesting: https://typegres.com/)