PageRenderTime 44ms CodeModel.GetById 16ms app.highlight 22ms RepoModel.GetById 1ms app.codeStats 0ms

/MapView/Map/FMDB/FMDatabase.h

http://github.com/route-me/route-me
C Header | 116 lines | 79 code | 36 blank | 1 comment | 0 complexity | 3f777a1d96e1380eb9472658df7f44f3 MD5 | raw file
  1#import <Foundation/Foundation.h>
  2#import "sqlite3.h"
  3#import "FMResultSet.h"
  4
  5@interface FMDatabase : NSObject 
  6{
  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;
 16    BOOL        shouldCacheStatements;
 17    NSMutableDictionary *cachedStatements;
 18}
 19
 20
 21+ (id)databaseWithPath:(NSString*)inPath;
 22- (id)initWithPath:(NSString*)inPath;
 23
 24- (BOOL) open;
 25#if SQLITE_VERSION_NUMBER >= 3005000
 26- (BOOL) openWithFlags:(int)flags;
 27#endif
 28- (BOOL) close;
 29- (BOOL) goodConnection;
 30- (void) clearCachedStatements;
 31
 32// encryption methods.  You need to have purchased the sqlite encryption extensions for these to work.
 33- (BOOL) setKey:(NSString*)key;
 34- (BOOL) rekey:(NSString*)key;
 35
 36
 37- (NSString *) databasePath;
 38
 39- (NSString*) lastErrorMessage;
 40
 41- (int) lastErrorCode;
 42- (BOOL) hadError;
 43- (sqlite_int64) lastInsertRowId;
 44
 45- (sqlite3*) sqliteHandle;
 46
 47- (BOOL) executeUpdate:(NSString*)sql, ...;
 48- (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
 49- (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this.  use the previous two instead.
 50
 51- (id) executeQuery:(NSString*)sql, ...;
 52- (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments;
 53- (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this.  use the previous two instead.
 54
 55- (BOOL) rollback;
 56- (BOOL) commit;
 57- (BOOL) beginTransaction;
 58- (BOOL) beginDeferredTransaction;
 59
 60- (BOOL)logsErrors;
 61- (void)setLogsErrors:(BOOL)flag;
 62
 63- (BOOL)crashOnErrors;
 64- (void)setCrashOnErrors:(BOOL)flag;
 65
 66- (BOOL)inUse;
 67- (void)setInUse:(BOOL)value;
 68
 69- (BOOL)inTransaction;
 70- (void)setInTransaction:(BOOL)flag;
 71
 72- (BOOL)traceExecution;
 73- (void)setTraceExecution:(BOOL)flag;
 74
 75- (BOOL)checkedOut;
 76- (void)setCheckedOut:(BOOL)flag;
 77
 78- (int)busyRetryTimeout;
 79- (void)setBusyRetryTimeout:(int)newBusyRetryTimeout;
 80
 81- (BOOL)shouldCacheStatements;
 82- (void)setShouldCacheStatements:(BOOL)value;
 83
 84- (NSMutableDictionary *)cachedStatements;
 85- (void)setCachedStatements:(NSMutableDictionary *)value;
 86
 87
 88+ (NSString*) sqliteLibVersion;
 89
 90
 91- (int)changes;
 92
 93@end
 94
 95@interface FMStatement : NSObject {
 96    sqlite3_stmt *statement;
 97    NSString *query;
 98    long useCount;
 99}
100
101
102- (void) close;
103- (void) reset;
104
105- (sqlite3_stmt *)statement;
106- (void)setStatement:(sqlite3_stmt *)value;
107
108- (NSString *)query;
109- (void)setQuery:(NSString *)value;
110
111- (long)useCount;
112- (void)setUseCount:(long)value;
113
114
115@end
116