How to turn of the Journal logging of CoreData/Sqlite?
How to turn of the Journal logging of CoreData/Sqlite?
- Subject: How to turn of the Journal logging of CoreData/Sqlite?
- From: James Cicenia <email@hidden>
- Date: Wed, 06 Apr 2016 09:43:32 -0500
What is the magic combination of options to send to the sqlite to completely turn off journaling.
I have an initialization on install that brings down a lot of data. I don’t need journaling at this point
and it balloons the memory storage upon install to over 500MB!
I have tried:
var options = Dictionary<NSObject, AnyObject>()
options[NSMigratePersistentStoresAutomaticallyOption] = true
options[NSInferMappingModelAutomaticallyOption] = true
options[NSSQLitePragmasOption] = ["journal_mode" : "TRUNCATE”]
or
options[NSSQLitePragmasOption] = ["journal_mode" : “OFF"]
or
options[NSSQLitePragmasOption] = ["journal_mode" : “DELETE”]
and
options[NSSQLiteManualVacuumOption] = true
even
options[NSSQLitePragmasOption] = ["journal_size_limit" : "20000”]
by :
do {
_ = try
self.managedObjectStore!.addSQLitePersistentStoreAtPath(storePath, fromSeedDatabaseAtPath: nil, withConfiguration: nil, options: options)
} catch let error as NSError {
print("fail to add persistent store")
print(error)
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden