aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMSQLite.m
diff options
context:
space:
mode:
Diffstat (limited to 'Foundation/GTMSQLite.m')
-rw-r--r--Foundation/GTMSQLite.m14
1 files changed, 13 insertions, 1 deletions
diff --git a/Foundation/GTMSQLite.m b/Foundation/GTMSQLite.m
index aa5d5f5..d3add68 100644
--- a/Foundation/GTMSQLite.m
+++ b/Foundation/GTMSQLite.m
@@ -133,13 +133,14 @@ static CFLocaleRef gCurrentLocale = NULL;
- (id)initWithPath:(NSString *)path
withCFAdditions:(BOOL)additions
utf8:(BOOL)useUTF8
+ flags:(int)flags
errorCode:(int *)err {
int rc = SQLITE_INTERNAL;
if ((self = [super init])) {
path_ = [path copy];
if (useUTF8) {
- rc = sqlite3_open([path_ fileSystemRepresentation], &db_);
+ rc = sqlite3_open_v2([path_ fileSystemRepresentation], &db_, flags, NULL);
} else {
CFStringEncoding cfEncoding;
#if TARGET_RT_BIG_ENDIAN
@@ -185,6 +186,17 @@ static CFLocaleRef gCurrentLocale = NULL;
return self;
}
+- (id)initWithPath:(NSString *)path
+ withCFAdditions:(BOOL)additions
+ utf8:(BOOL)useUTF8
+ errorCode:(int *)err {
+ return [self initWithPath:path
+ withCFAdditions:additions
+ utf8:useUTF8
+ flags:SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
+ errorCode:err];
+}
+
- (id)initInMemoryWithCFAdditions:(BOOL)additions
utf8:(BOOL)useUTF8
errorCode:(int *)err {