News for hackers. Stuff that matters.
Re:Is ORM still an anti-pattern? by rcme on Tuesday June 27, 2023 @05:35PM (#36498986)
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
    }
Re:Is ORM still an anti-pattern? by w7 on Tuesday June 27, 2023 @11:19PM (#36501850)
Some examples for anyone else reading:

Go: https://github.com/kyleconroy/sqlc

Rust: https://github.com/cornucopia-rs/cornucopia

This is my preferred method of interacting with databases now, if available.

Very flexible.