Yet another ORM?

Hey gophers,

I’ve always hit the same wall with Go ORMs, too much abstraction or too little control. So I decided to build my own: Margo. It still generates code, but keeps things simple and explicit.

Check out the benchmarks, performance has been solid so far. I’m already using it in production on a few projects, and it’s been great not having to manually write queries, convert structs, or chase missing fields anymore.

Would love your feedback, what features or improvements would you want to see next?

Interesting. How does your approach differ from SQLC?

Thanks for asking.

Well, the generated code isn’t as rigid as SQLC.
For example margo’s queries allow you to have functions with different “flavors”: without context, with context, with transaction or both context and transaction.
Including multiple queries in a transaction is not as complex as SQLC.

All queries are cached and prepared regardless of complexity, length, or character combinations. There are known quirks and limitations related to how sqlc parses SQL queries, especially involving complex or unusual escape characters in queries.

I just base64 encode them on generation and decode them on startup to get the original query back as it was written originally. Having both base64 and original queries can help debugging sometimes.

There’s still a lot to do, I just keep adding features as I need them.