blob: 38379405cfeed9b8b028905c22105842e927aa03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//
// FMDatabase+InMemoryOnDiskIO.h
// FMDB
//
// Created by Peter Carr on 6/12/12.
//
// I find there is a massive performance hit using an "on-disk" representation when
// constantly reading from or writing to the DB. If your machine has sufficient memory, you
// should get a significant performance boost using an "in-memory" representation. The FMDB
// warpper does not contain methods to load an "on-disk" representation into memory and
// similarly save an "in-memory" representation to disk. However, SQLite3 has built-in
// support for this functionality via its "Backup" API. Here, we extend the FMBD wrapper
// to include this functionality.
//
// https://sqlite.org/backup.html
#import "FMDatabase.h"
@interface FMDatabase (InMemoryOnDiskIO)
// Loads an on-disk representation into memory.
- (BOOL)readFromFile:(NSString*)filePath;
// Saves an in-memory representation to disk
- (BOOL)writeToFile:(NSString *)filePath;
@end
|