c# - NHibernate MySql : Create Database Automatically -
nhibernate create database automatically sqlite using
new schemaupdate(configuration).execute(false, true);
when seek mysql ,i see first have create schema manually, nhibernate create tables automatically me.
to give more concrete illustration suppose have connection string
<property name="connection.connection_string">database=mydatabase; info source=localhost;user id=x;password=y</property> if not create new schema has same name database in connection string manuelly or programatically :
"create schema if not exists " + "mydatabase"; nhibernate gives me error : unknown database "mydatabase".
if there schema called "mydatabase" exist before, nhibernate create tables automatically
so here short question :
is there way mysql database nhibernate create database automatically without creating schema before in mysql manually? if how?
nhibernate not create databases database system. sqlite itself create database inquire if doesn't exist, @ to the lowest degree when used through system.data.sqlite.dll. different other database engines.
the fact action not needed 1 database engine not in imply nhibernate must promise other database engine.
for question:
is possible create database automatically in mysql?
the reply is: "yes, write code perform required sql statements."
for question:
will nhibernate create mysql database automatically?
the reply is: "no".
c# mysql nhibernate orm
No comments:
Post a Comment