• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to turn of the Journal logging of CoreData/Sqlite?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to turn of the Journal logging of CoreData/Sqlite?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: iOS Hardware Keyboard Detection
  • Next by Date: Re: How to turn of the Journal logging of CoreData/Sqlite?
  • Previous by thread: Re: iOS Hardware Keyboard Detection
  • Next by thread: Re: How to turn of the Journal logging of CoreData/Sqlite?
  • Index(es):
    • Date
    • Thread