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:
authorAugust "Gus" Mueller <gus@flyingmeat.com>2013-12-10 22:00:45 +0400
committerAugust "Gus" Mueller <gus@flyingmeat.com>2013-12-10 22:00:45 +0400
commit4250e032274705cf50cf82dbd59ac255a8aa88b9 (patch)
tree152a50958bc3c2de4ef3ff7ca4ebc10376b9c069
parent4ef996a6221412e9551b80dcf1e32ae1c6edc980 (diff)
parenta1eb7305f80bf43f8e21bc08f1c24800d9a436dc (diff)
Merge pull request #213 from 5at5ish/master
Fix for issue #203: Add 'databaseClass' class method for FMDatabaseQueue.
-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 59c197e..daf6520 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 9b4a564..01b9e26 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