{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"actor"},{"kind":"text","text":" "},{"kind":"identifier","text":"SQLiteStorageEngine"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":" is significantly faster than "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/DiskStorageEngine"},{"type":"text","text":" because it uses SQLite"},{"type":"text","text":" "},{"type":"text","text":"rather than saving files to disk. As much as "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/DiskStorageEngine"},{"type":"text","text":" was optimized, file system operations"},{"type":"text","text":" "},{"type":"text","text":"like reading, writing, and removing files have a relatively high cost per operation, and SQLite"},{"type":"text","text":" "},{"type":"reference","isActive":true,"identifier":"https:\/\/www.sqlite.org\/fasterthanfs.html"},{"type":"text","text":" to be significantly faster than files for storing data."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"If you’re not using your own persistence mechanism such as Realm, Core Data, etc,"},{"type":"text","text":" "},{"type":"text","text":"it is highly recommended you use "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":" to power your "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/ObjectStorage"},{"type":"text","text":"."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"When initializing a database there is a possibility that the database Connection will fail."},{"type":"text","text":" "},{"type":"text","text":"There isn’t much reason to expect this, but it is a possibility so this initializer returns an optional."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"Generally creating implicitly unwrapped optionals is frowned upon, but it’s worth asking"},{"type":"text","text":" "},{"type":"text","text":"what will happen if you use one when initializing a "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":"."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"Code like this may look dangerous at first glance because of the "},{"type":"codeVoice","code":"!"},{"type":"text","text":","},{"type":"text","text":" "},{"type":"text","text":"but if that database is storing important data and fails to initialize"},{"type":"text","text":" "},{"type":"text","text":"then the app will likely not function as the user expects."}]},{"type":"codeListing","syntax":null,"code":["let storageEngine = SQLiteStorageEngine(directory: .documents(appending: \"Notes))!"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"The alternate experience is to continue running the app with a database not capable of saving data,"},{"type":"text","text":" "},{"type":"text","text":"an equally bad if not more confusing experience for a user."}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"One alternative is to make the initializer "},{"type":"codeVoice","code":"throw"},{"type":"text","text":", and that’s a perfectly reasonable tradeoff."},{"type":"text","text":" "},{"type":"text","text":"While that is doable, I believe it’s very unlikely the caller will have specific remedies for"},{"type":"text","text":" "},{"type":"text","text":"specific SQLite errors, so for simplicity I’ve made the initializer return an optional "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":"."}]}]}],"schemaVersion":{"major":0,"minor":2,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/bodega\/sqlitestorageengine"],"traits":[{"interfaceLanguage":"swift"}]}],"relationshipsSections":[{"identifiers":["doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine","doc:\/\/Bodega\/s8SendableP","doc:\/\/Bodega\/ScA"],"kind":"relationships","title":"Conforms To","type":"conformsTo"}],"identifier":{"url":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"A "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine"},{"type":"text","text":" based on an SQLite database."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"SQLiteStorageEngine"}],"title":"SQLiteStorageEngine","roleHeading":"Class","role":"symbol","symbolKind":"class","externalID":"s:6Bodega19SQLiteStorageEngineC","modules":[{"name":"Bodega"}],"navigatorTitle":[{"kind":"identifier","text":"SQLiteStorageEngine"}]},"hierarchy":{"paths":[["doc:\/\/Bodega\/documentation\/Bodega"]]},"topicSections":[{"title":"Initializers","identifiers":["doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/init(directory:databaseFilename:)"]},{"title":"Instance Methods","identifiers":["doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/allKeys()","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/createdAt(key:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/keyCount()","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/keyExists(_:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/read(key:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/read(keys:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readAllData()","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readAllDataAndKeys()","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readDataAndKeys(keys:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/remove(key:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/remove(keys:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/removeAllData()","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/updatedAt(key:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/write(_:)","doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/write(_:key:)"]},{"title":"Type Properties","identifiers":["doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/default"]},{"title":"Type Methods","identifiers":["doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/default(appendingPath:)"]}],"references":{"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/createdAt(key:)":{"role":"symbol","title":"createdAt(key:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"createdAt"},{"kind":"text","text":"("},{"kind":"externalParam","text":"key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"abstract":[{"type":"text","text":"Returns the date of creation for the "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" item matching the "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":", if it exists."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/createdAt(key:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/createdat(key:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/readAllData()":{"role":"symbol","title":"readAllData()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"readAllData"},{"kind":"text","text":"() -> ["},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":"]"}],"abstract":[{"type":"text","text":"Reads all the "},{"type":"codeVoice","code":"[Data]"},{"type":"text","text":" located in the database."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readAllData()","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/readalldata()"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/default":{"role":"symbol","title":"default","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"`default`"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"SQLiteStorageEngine","preciseIdentifier":"s:6Bodega19SQLiteStorageEngineC"}],"abstract":[{"type":"text","text":"An "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":" located in the platform-specific default storage directory."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/default","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/default"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/init(directory:databaseFilename:)":{"role":"symbol","title":"init(directory:databaseFilename:)","fragments":[{"kind":"identifier","text":"init"},{"kind":"text","text":"?("},{"kind":"externalParam","text":"directory"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"FileManager","preciseIdentifier":"c:objc(cs)NSFileManager"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Directory","preciseIdentifier":"s:So13NSFileManagerC6BodegaE9DirectoryV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"databaseFilename"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":")"}],"abstract":[{"type":"text","text":"Initializes a new "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":" for persisting "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" to disk."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/init(directory:databaseFilename:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/init(directory:databasefilename:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/removeAllData()":{"role":"symbol","title":"removeAllData()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"removeAllData"},{"kind":"text","text":"() "},{"kind":"keyword","text":"throws"}],"abstract":[{"type":"text","text":"Removes all the "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" items from the database."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/removeAllData()","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/removealldata()"},"doc://Bodega/ScA":{"type":"unresolvable","title":"_Concurrency.Actor","identifier":"doc:\/\/Bodega\/ScA"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/keyCount()":{"role":"symbol","title":"keyCount()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"keyCount"},{"kind":"text","text":"() -> "},{"kind":"typeIdentifier","text":"Int","preciseIdentifier":"s:Si"}],"abstract":[{"type":"text","text":"Iterates through the database to find the total number of "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" items."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/keyCount()","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/keycount()"},"doc://Bodega/documentation/Bodega":{"role":"collection","title":"Bodega","abstract":[{"type":"text","text":"A simple store all your basic needs, and also so much more. 🐱"}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega","kind":"symbol","type":"topic","url":"\/documentation\/bodega"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/keyExists(_:)":{"role":"symbol","title":"keyExists(_:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"keyExists"},{"kind":"text","text":"("},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"abstract":[{"type":"text","text":"Checks whether a value with a key is persisted."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/keyExists(_:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/keyexists(_:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/readAllDataAndKeys()":{"role":"symbol","title":"readAllDataAndKeys()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"readAllDataAndKeys"},{"kind":"text","text":"() -> [(key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":", data"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":")]"}],"abstract":[{"type":"text","text":"Reads all the "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" located in the database and returns an array"},{"type":"text","text":" "},{"type":"text","text":"of "},{"type":"codeVoice","code":"[(CacheKey, Data)]"},{"type":"text","text":" tuples associated with the "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readAllDataAndKeys()","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/readalldataandkeys()"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/write(_:key:)":{"role":"symbol","title":"write(_:key:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"write"},{"kind":"text","text":"("},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") "},{"kind":"keyword","text":"throws"}],"abstract":[{"type":"text","text":"Writes "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" to the database with an associated "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/write(_:key:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/write(_:key:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/allKeys()":{"role":"symbol","title":"allKeys()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"allKeys"},{"kind":"text","text":"() -> ["},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":"]"}],"abstract":[{"type":"text","text":"Iterates through the database to find all of the keys."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/allKeys()","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/allkeys()"},"doc://Bodega/documentation/Bodega/ObjectStorage":{"role":"symbol","title":"ObjectStorage","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"ObjectStorage"}],"abstract":[{"type":"text","text":"A unified layer over a "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine"},{"type":"text","text":" primitives, allowing you to read, write, and save Swift objects."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/ObjectStorage","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"ObjectStorage"}],"url":"\/documentation\/bodega\/objectstorage"},"doc://Bodega/documentation/Bodega/CacheKey":{"role":"symbol","title":"CacheKey","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"CacheKey"}],"abstract":[{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" is a type meant to provide a stable storage key."},{"type":"text","text":" "},{"type":"text","text":"If initialized from a URL the "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" value will generate"},{"type":"text","text":" "},{"type":"text","text":"a consistent UUID-formatted MD5 version of the URL string as the key"},{"type":"text","text":" "},{"type":"text","text":"to ensure it is file system safe."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"CacheKey"}],"url":"\/documentation\/bodega\/cachekey"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/read(key:)":{"role":"symbol","title":"read(key:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"read"},{"kind":"text","text":"("},{"kind":"externalParam","text":"key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":"?"}],"abstract":[{"type":"text","text":"Reads "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" from disk based on the associated "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/read(key:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/read(key:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/default(appendingPath:)":{"role":"symbol","title":"default(appendingPath:)","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"`default`"},{"kind":"text","text":"("},{"kind":"externalParam","text":"appendingPath"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"SQLiteStorageEngine","preciseIdentifier":"s:6Bodega19SQLiteStorageEngineC"}],"abstract":[{"type":"text","text":"An "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine"},{"type":"text","text":" located in the platform-specific default storage directory."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/default(appendingPath:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/default(appendingpath:)"},"doc://Bodega/documentation/Bodega/StorageEngine":{"role":"symbol","title":"StorageEngine","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"StorageEngine"}],"abstract":[{"type":"text","text":"A "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine"},{"type":"text","text":" represents a data storage mechanism for saving and persisting data."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"StorageEngine"}],"url":"\/documentation\/bodega\/storageengine"},"https://www.sqlite.org/fasterthanfs.html":{"title":"has been shown","titleInlineContent":[{"type":"text","text":"has been shown"}],"type":"link","identifier":"https:\/\/www.sqlite.org\/fasterthanfs.html","url":"https:\/\/www.sqlite.org\/fasterthanfs.html"},"doc://Bodega/documentation/Bodega/DiskStorageEngine":{"role":"symbol","title":"DiskStorageEngine","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"DiskStorageEngine"}],"abstract":[{"type":"text","text":"A "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine"},{"type":"text","text":" based on saving items to the file system."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/DiskStorageEngine","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"DiskStorageEngine"}],"url":"\/documentation\/bodega\/diskstorageengine"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/updatedAt(key:)":{"role":"symbol","title":"updatedAt(key:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"updatedAt"},{"kind":"text","text":"("},{"kind":"externalParam","text":"key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Date","preciseIdentifier":"s:10Foundation4DateV"},{"kind":"text","text":"?"}],"abstract":[{"type":"text","text":"Returns the modification date for the "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" item matching the "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":", if it exists."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/updatedAt(key:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/updatedat(key:)"},"doc://Bodega/s8SendableP":{"type":"unresolvable","title":"Swift.Sendable","identifier":"doc:\/\/Bodega\/s8SendableP"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/read(keys:)":{"role":"symbol","title":"read(keys:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"read"},{"kind":"text","text":"("},{"kind":"externalParam","text":"keys"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":"]) -> ["},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":"]"}],"abstract":[{"type":"text","text":"Reads "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" items based on the associated array of "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"s provided as a parameter."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/read(keys:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/read(keys:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/write(_:)":{"role":"symbol","title":"write(_:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"write"},{"kind":"text","text":"([(key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":", data"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":")]) "},{"kind":"keyword","text":"throws"}],"abstract":[{"type":"text","text":"Writes an array of "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" items to the database with their associated "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" from the tuple."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/write(_:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/write(_:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine":{"role":"symbol","title":"SQLiteStorageEngine","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"SQLiteStorageEngine"}],"abstract":[{"type":"text","text":"A "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/StorageEngine"},{"type":"text","text":" based on an SQLite database."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SQLiteStorageEngine"}],"url":"\/documentation\/bodega\/sqlitestorageengine"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/remove(keys:)":{"role":"symbol","title":"remove(keys:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"remove"},{"kind":"text","text":"("},{"kind":"externalParam","text":"keys"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":"]) "},{"kind":"keyword","text":"throws"}],"abstract":[{"type":"text","text":"Removes "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" items from the database based on the associated array of "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"s provided as a parameter."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/remove(keys:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/remove(keys:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/readDataAndKeys(keys:)":{"role":"symbol","title":"readDataAndKeys(keys:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"readDataAndKeys"},{"kind":"text","text":"("},{"kind":"externalParam","text":"keys"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":"]) -> [(key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":", data"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Data","preciseIdentifier":"s:10Foundation4DataV"},{"kind":"text","text":")]"}],"abstract":[{"type":"text","text":"This method returns the "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" and "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" together in a tuple of "},{"type":"codeVoice","code":"[(CacheKey, Data)]"},{"type":"text","text":" "},{"type":"text","text":"allowing you to know which "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" led to a specific "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" item being retrieved."},{"type":"text","text":" "},{"type":"text","text":"This can be useful in allowing manual iteration over data, but if you don’t need"},{"type":"text","text":" "},{"type":"text","text":"to know which "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":" that led to a piece of "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" being retrieved"},{"type":"text","text":" "},{"type":"text","text":"you can use "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/read(keys:)"},{"type":"text","text":" instead."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/readDataAndKeys(keys:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/readdataandkeys(keys:)"},"doc://Bodega/documentation/Bodega/SQLiteStorageEngine/remove(key:)":{"role":"symbol","title":"remove(key:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"remove"},{"kind":"text","text":"("},{"kind":"externalParam","text":"key"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"CacheKey","preciseIdentifier":"s:6Bodega8CacheKeyV"},{"kind":"text","text":") "},{"kind":"keyword","text":"throws"}],"abstract":[{"type":"text","text":"Removes "},{"type":"codeVoice","code":"Data"},{"type":"text","text":" from disk based on the associated "},{"type":"reference","isActive":true,"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/CacheKey"},{"type":"text","text":"."}],"identifier":"doc:\/\/Bodega\/documentation\/Bodega\/SQLiteStorageEngine\/remove(key:)","kind":"symbol","type":"topic","url":"\/documentation\/bodega\/sqlitestorageengine\/remove(key:)"}}}