Comment

Comment by rcme

There are libraries that flip the concept of an ORM on its head. Instead of a library that allows lazy query composition, you write your queries and the library generates the code for that query at compile time. It’s a much better model in my opinion.

E.g. you could write a query like this:

    getUser:
    SELECT * FROM users WHERE id = ?
And the library would generate a class like:

    class GetUserQuery {
        static getUser(id: String): GetUserQueryResult
    }
parent rcme 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton