|
|
|
|
|
by weberc2
3291 days ago
|
|
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 SQLAlchemy--in Go this can be either explicit or inferred once via reflection or code generation) and I don't think performance would be more a challenge in Go than any other language (the trick to ORM performance is in building efficient SQL queries, not in reflection or type asserts). |
|
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 that you're storing your object graph ( or struct graph in the case of go) in a relationnal database. To do so, the developper provides meta data , like an xml file or annotation, to describe the mapping. This is a pretty hard problem.