Live data from Hacker News

Macaron: a high productive and modular web framework in Go

go-macaron.com

51–52 of 52 posts

Re: Macaron: a high productive and modular web framework in Go

#51
post #49
post #45

Earlier quoted context omitted.

I'm not sure exactly what you mean about parameterization, but I suspect in general my notion of what an ORM is differs from yours (in particular, I don't assume lazy loading). Maybe what I'm thinking isn't appropriately called "ORM" (maybe "type relational mapping" is more appropriate?). At any rate, I don't think type safety should be a challenge (somehow a mapping must be generated for each type, just like SQLAlch…

compile-time code generation can only get you so far, unless you're ready to generate every single kind of query beforehand ( which grows exponentially with the number of -to-many relationship). You'll have to rely on introspection but i suspect things won't go smoothly. anyway, it should make for a good exercise i'm sure. as for the definition of Object-Relationnal-Mapper the idea is to completely abstract the fact…

It's not too difficult. Where I work, we're building a BI tool that maps domain concepts ("objects") to fields in relational databases (we're using Python and building out SQLAlchemy queries, but we're not doing anything that wouldn't easily translate into Go). The domain concepts are analogous to structs in Go or simple classes in Python. You only need to get the mapping data once (in our case, the user configures these mappings in the UI and then we load them at runtime, but these could come from anywhere) and from then on there is no magic.

If you know ahead of time what your types are, then you can do everything in code gen easily.

The tough bit is query optimization.

Re: Macaron: a high productive and modular web framework in Go

#52
post #27

Earlier quoted context omitted.

We use SQLalchemy at work and I would rather write queries by hand. A lot of that is because the documentation is a huge pain, but also because the object composition isn't intuitive. I've built a profile query builder in Go and it was pretty straight forward; I'm confident I could build an ORM in a couple of weeks.

You could do in weeks what has taken the hibernate folks years and years?

Hibernate is a lot more than a simple proof of concept...
Post reply on HN