Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ccgus/fmdb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Islamgulov <timislamgulov@yahoo.com>2013-12-05 15:42:38 +0400
committerTimur Islamgulov <timislamgulov@yahoo.com>2013-12-05 15:42:38 +0400
commita1eb7305f80bf43f8e21bc08f1c24800d9a436dc (patch)
tree8a224e8a83dad5289361f88be94dc09810b052b0
parente70cd055a6440f1ef254a4549117553b1f97e5b8 (diff)
Fix for issue #203: Add 'databaseClass' class method for FMDatabaseQueue. Subclasses can override this method to return specified Class of 'FMDatabase' subclass.
-rw-r--r--src/FMDatabaseQueue.h9
-rw-r--r--src/FMDatabaseQueue.m6
2 files changed, 14 insertions, 1 deletions
diff --git a/src/FMDatabaseQueue.h b/src/FMDatabaseQueue.h
index 555c2d2..1c16e04 100644
--- a/src/FMDatabaseQueue.h
+++ b/src/FMDatabaseQueue.h
@@ -112,6 +112,15 @@
- (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags;
+/** Returns the Class of 'FMDatabase' subclass, that will be used to instantiate database object.
+
+ Subclasses can override this method to return specified Class of 'FMDatabase' subclass.
+
+ @return The Class of 'FMDatabase' subclass, that will be used to instantiate database object.
+ */
+
++ (Class)databaseClass;
+
/** Close database used by queue. */
- (void)close;
diff --git a/src/FMDatabaseQueue.m b/src/FMDatabaseQueue.m
index c302093..68cfa6f 100644
--- a/src/FMDatabaseQueue.m
+++ b/src/FMDatabaseQueue.m
@@ -40,6 +40,10 @@
return q;
}
++ (Class)databaseClass
+{
+ return [FMDatabase class];
+}
- (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags {
@@ -47,7 +51,7 @@
if (self != nil) {
- _db = [FMDatabase databaseWithPath:aPath];
+ _db = [[[self class] databaseClass] databaseWithPath:aPath];
FMDBRetain(_db);
#if SQLITE_VERSION_NUMBER >= 3005000