I have problem with setting sqlite database file to auto shrink. The code I’m using to configure database is:
Fluently.Configure()
.Database(SQLiteConfiguration.Standard.ConnectionString("PRAGMA auto_vacuum=FULL").UsingFile("file.sqlite"))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Application.NHibernateSessionManager>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
After creating ~15000 records database file is ~1MB large. When I delete everything the database file is still ~1MB.
How do you configure sqlite using fluent nhibernate to work with pragma “auto_vacuum”?
I’m not sure this applies to auto_vacuum, but with other pragmas, I configure the db “normally”, then execute the pragma as an update, for example:
This was initialized using FluentNHibernate like this: