encryption macro la la la
[fmdb.git] / src / FMDatabase.h
blob7776e244ea6e6fed07ce9639478d4c9cf4f0741a
1 #import <Foundation/Foundation.h>
2 #import "sqlite3.h"
3 #import "FMResultSet.h"
5 @interface FMDatabase : NSObject
7 sqlite3* db;
8 NSString* databasePath;
9 BOOL logsErrors;
10 BOOL crashOnErrors;
11 BOOL inUse;
12 BOOL inTransaction;
13 BOOL traceExecution;
14 BOOL checkedOut;
15 int busyRetryTimeout;
18 + (id)databaseWithPath:(NSString*)inPath;
19 - (id)initWithPath:(NSString*)inPath;
21 - (BOOL) open;
22 - (void) close;
23 - (BOOL) goodConnection;
25 // encryption methods. You need to have purchased the sqlite encryption extensions for these to work.
26 - (BOOL) setKey:(NSString*)key;
27 - (BOOL) rekey:(NSString*)key;
30 - (NSString *) databasePath;
32 - (NSString*) lastErrorMessage;
34 - (int) lastErrorCode;
35 - (BOOL) hadError;
36 - (sqlite_int64) lastInsertRowId;
38 - (sqlite3*) sqliteHandle;
40 - (BOOL) executeUpdate:(NSString *)sql arguments:(va_list)args;
41 - (BOOL) executeUpdate:(NSString*)sql, ...;
43 - (id) executeQuery:(NSString *)sql arguments:(va_list)args;
44 - (id) executeQuery:(NSString*)sql, ...;
46 - (BOOL) rollback;
47 - (BOOL) commit;
48 - (BOOL) beginTransaction;
49 - (BOOL) beginDeferredTransaction;
51 - (BOOL)logsErrors;
52 - (void)setLogsErrors:(BOOL)flag;
54 - (BOOL)crashOnErrors;
55 - (void)setCrashOnErrors:(BOOL)flag;
57 - (BOOL)inUse;
58 - (void)setInUse:(BOOL)flag;
60 - (BOOL)inTransaction;
61 - (void)setInTransaction:(BOOL)flag;
63 - (BOOL)traceExecution;
64 - (void)setTraceExecution:(BOOL)flag;
66 - (BOOL)checkedOut;
67 - (void)setCheckedOut:(BOOL)flag;
69 - (int)busyRetryTimeout;
70 - (void)setBusyRetryTimeout:(int)newBusyRetryTimeout;
73 + (NSString*) sqliteLibVersion;
77 @end