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?
PetaPoco is a thin Object Relational Mapper (ORM) for . NET applications.
OrmLite is a set of light-weight C# extension methods around System. Data. * interfaces which is designed to persist POCO classes with a minimal amount of intrusion and configuration. Another Orm with similar goals is sqlite-net.
A database repository is a logical, but also sometimes physical grouping of data from related but separate databases. This is usually done when there is a 'higher purpose' for the data, but the data items needed to do this reside on different databases.
If you're writing a new ASP.NET Core application that needs to work with relational data, then Entity Framework Core (EF Core) is the recommended way for your application to access its data. EF Core is an object-relational mapper (O/RM) that enables . NET developers to persist objects to and from a data source.
ServiceStack's ORMLite is a Micro ORM that can create db schemas. It has CreateTable and DropTable methods.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With