![]() |
Ignite Tools
|
00001 #import <Foundation/Foundation.h> 00002 #import "sqlite3.h" 00003 #import "UA_FMResultSet.h" 00004 00005 @interface UA_FMDatabase : NSObject 00006 { 00007 sqlite3* db; 00008 NSString* databasePath; 00009 BOOL logsErrors; 00010 BOOL crashOnErrors; 00011 BOOL inUse; 00012 BOOL inTransaction; 00013 BOOL traceExecution; 00014 BOOL checkedOut; 00015 int busyRetryTimeout; 00016 BOOL shouldCacheStatements; 00017 NSMutableDictionary *cachedStatements; 00018 } 00019 00020 00021 + (id)databaseWithPath:(NSString*)inPath; 00022 - (id)initWithPath:(NSString*)inPath; 00023 00024 - (BOOL) open; 00025 #if SQLITE_VERSION_NUMBER >= 3005000 00026 - (BOOL) openWithFlags:(int)flags; 00027 #endif 00028 - (void) close; 00029 - (BOOL) goodConnection; 00030 - (void) clearCachedStatements; 00031 00032 // encryption methods. You need to have purchased the sqlite encryption extensions for these to work. 00033 - (BOOL) setKey:(NSString*)key; 00034 - (BOOL) rekey:(NSString*)key; 00035 00036 00037 - (NSString *) databasePath; 00038 00039 - (NSString*) lastErrorMessage; 00040 00041 - (int) lastErrorCode; 00042 - (BOOL) hadError; 00043 - (sqlite_int64) lastInsertRowId; 00044 00045 - (sqlite3*) sqliteHandle; 00046 00047 - (BOOL) executeUpdate:(NSString*)sql, ...; 00048 - (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments; 00049 - (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this. use the previous two instead. 00050 00051 - (id) executeQuery:(NSString*)sql, ...; 00052 - (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments; 00053 - (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this. use the previous two instead. 00054 00055 - (BOOL) rollback; 00056 - (BOOL) commit; 00057 - (BOOL) beginTransaction; 00058 - (BOOL) beginDeferredTransaction; 00059 00060 - (BOOL)logsErrors; 00061 - (void)setLogsErrors:(BOOL)flag; 00062 00063 - (BOOL)crashOnErrors; 00064 - (void)setCrashOnErrors:(BOOL)flag; 00065 00066 - (BOOL)inUse; 00067 - (void)setInUse:(BOOL)value; 00068 00069 - (BOOL)inTransaction; 00070 - (void)setInTransaction:(BOOL)flag; 00071 00072 - (BOOL)traceExecution; 00073 - (void)setTraceExecution:(BOOL)flag; 00074 00075 - (BOOL)checkedOut; 00076 - (void)setCheckedOut:(BOOL)flag; 00077 00078 - (int)busyRetryTimeout; 00079 - (void)setBusyRetryTimeout:(int)newBusyRetryTimeout; 00080 00081 - (BOOL)shouldCacheStatements; 00082 - (void)setShouldCacheStatements:(BOOL)value; 00083 00084 - (NSMutableDictionary *)cachedStatements; 00085 - (void)setCachedStatements:(NSMutableDictionary *)value; 00086 00087 00088 + (NSString*) sqliteLibVersion; 00089 00090 00091 - (int)changes; 00092 00093 @end 00094 00095 @interface UA_FMStatement : NSObject { 00096 sqlite3_stmt *statement; 00097 NSString *query; 00098 long useCount; 00099 } 00100 00101 00102 - (void) close; 00103 - (void) reset; 00104 00105 - (sqlite3_stmt *)statement; 00106 - (void)setStatement:(sqlite3_stmt *)value; 00107 00108 - (NSString *)query; 00109 - (void)setQuery:(NSString *)value; 00110 00111 - (long)useCount; 00112 - (void)setUseCount:(long)value; 00113 00114 00115 @end 00116