I am using NHibernate with FluentNHibernate for my DAL. I am also using SchemaExport
and SchemaUpdate
to create and update my database schema.
No, NHibernate will not create the database for you. Creating databases is something you usually don't want do be done on the fly. It needs many configuration parameters and this is very database specific, even database version specific.
For our product, I wrote a class that sets up the database. It is used for the installer, the integration tests and the database maintenance tool.
There is also a special case, where a customer doesn't want to grant the right to create databases. Then we expect him to do it and skip this part.