Skip to content

Commit

Permalink
add database open with VSF virtual file system
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Sechelmann committed May 31, 2015
1 parent c4d0ae7 commit ef9effb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/fmdb/FMDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary

#if SQLITE_VERSION_NUMBER >= 3005000
- (BOOL)openWithFlags:(int)flags;
- (BOOL)openWithFlags:(int)flags andVFS:(const char*)vfs;
#endif

/** Closing a database connection
Expand Down
5 changes: 4 additions & 1 deletion src/fmdb/FMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,14 @@ - (BOOL)open {

#if SQLITE_VERSION_NUMBER >= 3005000
- (BOOL)openWithFlags:(int)flags {
return [self openWithFlags:flags andVFS:NULL];
}
- (BOOL)openWithFlags:(int)flags andVFS:(const char*)vfs {
if (_db) {
return YES;
}

int err = sqlite3_open_v2([self sqlitePath], &_db, flags, NULL /* Name of VFS module to use */);
int err = sqlite3_open_v2([self sqlitePath], &_db, flags, vfs);
if(err != SQLITE_OK) {
NSLog(@"error opening!: %d", err);
return NO;
Expand Down

0 comments on commit ef9effb

Please sign in to comment.