lundi 13 juillet 2015

NHibernate default schema is ignored for SqlLite

When using NHibernate schema export I configure it as follows:

Fluently().Configure
            .Database(SQLiteConfiguration.Standard
                .DefaultSchema("someschema")
                .Provider<SqliteInMemoryDriverConnectionProvider>()
                .ShowSql()
                .FormatSql()
                .Raw(Environment.GenerateStatistics, "true"))

However, when I look at the generated tables (using SchemaExport) they are generated like this:

Create table dbo_sometable ... 

It looks like it's still using the standard dbo-prefix. How can I generate the table without the dbo-prefix?

More info:

I'm trying to run some integration tests using NHibernate in-memory. I do some NHibernate inserts and updates (they work fine, since they automatically add the schema prefix as well). I'm also doing some manual queries on the same tables though, that use just the table name. On live code this works fine (to a MS SQL database), in the test code it fails because it doesn't find the table sometable, since it was generated as dbo_sometable

Aucun commentaire:

Enregistrer un commentaire