|
|
@@ -34,6 +34,7 @@ @implementation FMDatabaseQueue
|
|
|
|
|
|
@synthesize path = _path;
|
|
|
@synthesize openFlags = _openFlags;
|
|
|
+@synthesize vfsName = _vfsName;
|
|
|
|
|
|
+ (instancetype)databaseQueueWithPath:(NSString*)aPath {
|
|
|
|
|
|
@@ -82,6 +83,7 @@ - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags vfs:(NSString
|
|
|
_queue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL);
|
|
|
dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
|
|
|
_openFlags = openFlags;
|
|
|
+ _vfsName = [vfsName copy];
|
|
|
}
|
|
|
|
|
|
return self;
|
|
|
@@ -128,10 +130,10 @@ - (void)close {
|
|
|
|
|
|
- (FMDatabase*)database {
|
|
|
if (!_db) {
|
|
|
- _db = FMDBReturnRetained([FMDatabase databaseWithPath:_path]);
|
|
|
+ _db = FMDBReturnRetained([[[self class] databaseClass] databaseWithPath:_path]);
|
|
|
|
|
|
#if SQLITE_VERSION_NUMBER >= 3005000
|
|
|
- BOOL success = [_db openWithFlags:_openFlags];
|
|
|
+ BOOL success = [_db openWithFlags:_openFlags vfs:_vfsName];
|
|
|
#else
|
|
|
BOOL success = [_db open];
|
|
|
#endif
|