this post was submitted on 07 Jul 2023
15 points (100.0% liked)

Golang

313 readers
8 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Think of it as a reverse ORM: you write SQL queries in a text file, run sqlc generate, and then continue writing your code.

That's not a reverse ORM, that's just an ORM. Object relational mapping is independent of query building.

The active record pattern attempts to combine ORM and query building together and does so by driving queries from the models rather than the models being derived from the queries. It might be fair to call this a reverse active record pattern.