4 ms·
I'm the author of a code-generation ORM in Go (real orm, does relationships fairly robustly) https://github.com/vattle/sqlboiler https://github.com/vattle/sqlbo
by aarondl0 10y ago
I'm the author of a code-generation ORM in Go (real orm, does relationships fairly robustly) https://github.com/vattle/sqlboiler https://github.com/vattle/sqlboiler and I'm curious why you needed to make another one despite something like this existing? Granted we don't support sqlite/mssql yet, but surely a PR to support it is easier than writing your own :(
- samonzeweb 10y agoThe projet started as a learning one. I made some independent and experimental component from time to time, and then glued them together, rewriting some parts, ... Why this kind of project ? Because I used Active Record (Rails), Entity Framework, played with Django ORM, ... and regretted that nothing similar exist in Go world. Instead of complaining I choose to do something, not building a full ORM by myself, but at least build something allowing me to have a better comprehension of the constraints (except of the classic "no generic"). I didn't choose to build another Go library thinking I'll build something better than others. I learned, and I got a library ;)
- aarondl0 10y agoWell, now that you're done learning I hope you'll become an sqlboiler user and maybe contribute to it to fit your use case too. Fragmentation in the sql world in Go is pretty bad right now, hence my reaction to seeing your lib, sorry for that :)
- assafmo 10y agoWhy do you think "Fragmentation" is bad?
- xupybd 10y agoSplits development effort, slips developer skill across many options. Means everyone wastes time re-inventing the wheel instead of solving the problems they want to.
- aarondl0 10y agoI want to see the Go community and it's libraries flourish. But having libraries like this around which provide extra confusing and probably poorly maintained choices for users is detrimental to it's overall health. There's already great examples of maintenance rot found even amongst the very popular libraries like go-yaml and httprouter. One thing you can say about Go is it has 1000 Micro-frameworks, ORMs, Routers, and Logging libraries. Most of them are within a percent of giving the exact same feature set with the exact same approach and and ever so slightly different API. Lots of them share the same mistakes as they are a user's first project or a learning arena (though routing has been a pretty benchmarked area so that's been better than the others). As someone who has open source libraries, and who uses Go in their day job and at home my personal opinion is that Go needs fewer, stronger libraries. Well supported, well maintained pieces rather than this illusion of choice that's presented today. I'm sorry if I came off as crass in my reply to the OP but that's simply the state I see in the community today. Ideally there'd be 2-4 ORMs in Go that would be the goto. And half would use a code-generation approach, half would use the reflection based approach. https://github.com/astaxie/beego/tree/master/orm https://github.com/astaxie/beego/tree/master/orm https://github.com/cosiner/gomodel https://github.com/cosiner/gomodel https://github.com/jinzhu/gorm https://github.com/jinzhu/gorm https://github.com/go-gorp/gorp https://github.com/go-gorp/gorp https://github.com/coocood/qbs https://github.com/coocood/qbs https://github.com/go-reform/reform https://github.com/go-reform/reform https://github.com/vattle/sqlboiler https://github.com/vattle/sqlboiler https://github.com/upper/db https://github.com/upper/db https://github.com/astaxie/beedb https://github.com/astaxie/beedb https://github.com/naoina/genmai https://github.com/naoina/genmai https://github.com/monochromegane/argen https://github.com/monochromegane/argen https://github.com/square/squalor https://github.com/square/squalor https://github.com/theduke/go-dukedb https://github.com/theduke/go-dukedb https://github.com/dropbox/godropbox/tree/master/database/sqlbuilder https://github.com/dropbox/godropbox/tree/master/database/sq... (...and more) And now: https://github.com/samonzeweb/godb https://github.com/samonzeweb/godb Do we truly need this? This one in particular feels a lot like upperdb. And if it's for learning only, don't publish it to things like hackers news which makes people seem like it's something you should use as opposed to the more mature libraries out there. This is what I meant by fragmentation, it's an illusion of choice. There are actually very few logging/routing/orm/micro-framework libraries you should really use if you're serious about a project.
- stcredzero 10y agoI just took a look, and found that I like this. Then I thought for a moment about why. The inspiration from ActiveRecord has something to do with it being "opinionated." However, there's more to it. I think I just realized that the best tools for increasing productivity are "opinionated" because they are developer "workflow-centric" as opposed to "code-centric." Code-centered tools are really good at creating blog-post sized examples, but can fall down when it comes to involved work. Developer workflow centered tools that arise from actual production work aren't quite as good at creating blog-post sized examples, but can be wonderful for getting things done.