Reputation: 14097
We'd like to get rid of NHibernate for something like Massive, PetaPoco, etc. but we really like the ability to generate our database automatically. With attributes it seems like PetaPoco has the information it needs to generate the db but I can't find anything that says it does.
Is there an alternative Micro ORM that does suport this?
Upvotes: 6
Views: 1076
Reputation: 13511
It seems that SqlFu can create schemas, as well as truncate, drop and check if exists.
Upvotes: 0
Reputation: 1286
ServiceStack's ORMLite is a Micro ORM that can create db schemas. It has CreateTable and DropTable methods.
Upvotes: 3
Reputation: 5875
I looked into this extensively almost 2 years ago.
At that time, the only package that could automatically create a db schema from a real world (as opposed to toy) object model was the "big ORM" Fluent NHibernate Automapping , so that's what we ended up using.
It's generally worked well for us (though to be honest - session management is a pain, and we're currently having some problems upgrading to FNH 1.3/NH 3.2). But on balance, it's been a big win.
Subsonic looked very promising at the time - it was certainly much easier to use than FNH/NH. However, it only did very simple schemas like ActiveRecord automatically. Last I heard, it was no longer under active development, which is really too bad.
There may be other micro ORM options available now that will generate the schema, but I'm not aware of them.
If you just need persistance (as opposed to a relational database), you might want to look at some of the NoSQL options. I find RavenDB very interesting - seems to be as easy to use as Subsonic, but much more powerful. (licensing looks expensive, though).
Upvotes: 1