// Header exposed for unit testing only
+#if __OBJC2__
+
#import <Foundation/Foundation.h>
#import <sqlite3.h>
SFSQLiteSynchronousModeFull = 2
};
-@protocol SFSQLiteDelegate
+@protocol SFSQLiteDelegate <NSObject>
@property (nonatomic, readonly) SInt32 userVersion;
- (BOOL)migrateDatabase:(SFSQLite *)db fromVersion:(SInt32)version;
// Wrapper around the SQLite API. Typically subclassed to add table accessor methods.
@interface SFSQLite : NSObject {
+@private
id<SFSQLiteDelegate> _delegate;
NSString* _path;
NSString* _schema;
- (void)analyze;
- (void)vacuum;
-// Raise an exception. Including any database error in the description and removing the databse if it's corrupt.
-- (void)raise:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
-
// The rowID assigned to the last record inserted into the database.
- (SFSQLiteRowID)lastInsertRowID;
- (int)changes;
// Execute one-or-more queries. Use prepared statements for anything performance critical.
-- (void)executeSQL:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
-- (void)executeSQL:(NSString *)format arguments:(va_list)args NS_FORMAT_FUNCTION(1, 0);
+- (BOOL)executeSQL:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+- (BOOL)executeSQL:(NSString *)format arguments:(va_list)args NS_FORMAT_FUNCTION(1, 0);
// Prepared statement pool accessors. Statements must be reset after they're used.
- (SFSQLiteStatement *)statementForSQL:(NSString *)SQL;
- (SInt32)dbUserVersion;
@end
+
+#endif