|
|
@@ -8,11 +8,28 @@
|
|
|
#import <sqlite3.h>
|
|
|
#endif
|
|
|
|
|
|
-@interface FMDatabase ()
|
|
|
+@interface FMDatabase () {
|
|
|
+ void* _db;
|
|
|
+ NSString* _databasePath;
|
|
|
+ BOOL _shouldCacheStatements;
|
|
|
+ BOOL _isExecutingStatement;
|
|
|
+ BOOL _inTransaction;
|
|
|
+ NSTimeInterval _maxBusyRetryTimeInterval;
|
|
|
+ NSTimeInterval _startBusyRetryTime;
|
|
|
+
|
|
|
+ NSMutableSet *_openResultSets;
|
|
|
+ NSMutableSet *_openFunctions;
|
|
|
+
|
|
|
+ NSDateFormatter *_dateFormat;
|
|
|
+}
|
|
|
+
|
|
|
+NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
- (FMResultSet * _Nullable)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray * _Nullable)arrayArgs orDictionary:(NSDictionary * _Nullable)dictionaryArgs orVAList:(va_list)args;
|
|
|
- (BOOL)executeUpdate:(NSString *)sql error:(NSError * _Nullable *)outErr withArgumentsInArray:(NSArray * _Nullable)arrayArgs orDictionary:(NSDictionary * _Nullable)dictionaryArgs orVAList:(va_list)args;
|
|
|
|
|
|
+NS_ASSUME_NONNULL_END
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation FMDatabase
|
|
|
@@ -1461,7 +1478,7 @@ - (void)makeFunctionNamed:(NSString *)name arguments:(int)arguments block:(void
|
|
|
|
|
|
/* I tried adding custom functions to release the block when the connection is destroyed- but they seemed to never be called, so we use _openFunctions to store the values instead. */
|
|
|
#if ! __has_feature(objc_arc)
|
|
|
- sqlite3_create_function([self sqliteHandle], [name UTF8String], count, SQLITE_UTF8, (void*)b, &FMDBBlockSQLiteCallBackFunction, 0x00, 0x00);
|
|
|
+ sqlite3_create_function([self sqliteHandle], [name UTF8String], arguments, SQLITE_UTF8, (void*)b, &FMDBBlockSQLiteCallBackFunction, 0x00, 0x00);
|
|
|
#else
|
|
|
sqlite3_create_function([self sqliteHandle], [name UTF8String], arguments, SQLITE_UTF8, (__bridge void*)b, &FMDBBlockSQLiteCallBackFunction, 0x00, 0x00);
|
|
|
#endif
|