/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. @interface FMDatabase : NSObject
  5. {
  6. sqlite3* db;
  7. NSString* databasePath;
  8. BOOL logsErrors;
  9. BOOL crashOnErrors;
  10. BOOL inUse;
  11. BOOL inTransaction;
  12. BOOL traceExecution;
  13. BOOL checkedOut;
  14. int busyRetryTimeout;
  15. BOOL shouldCacheStatements;
  16. NSMutableDictionary *cachedStatements;
  17. }
  18. + (id)databaseWithPath:(NSString*)inPath;
  19. - (id)initWithPath:(NSString*)inPath;
  20. - (BOOL) open;
  21. #if SQLITE_VERSION_NUMBER >= 3005000
  22. - (BOOL) openWithFlags:(int)flags;
  23. #endif
  24. - (BOOL) close;
  25. - (BOOL) goodConnection;
  26. - (void) clearCachedStatements;
  27. // encryption methods. You need to have purchased the sqlite encryption extensions for these to work.
  28. - (BOOL) setKey:(NSString*)key;
  29. - (BOOL) rekey:(NSString*)key;
  30. - (NSString *) databasePath;
  31. - (NSString*) lastErrorMessage;
  32. - (int) lastErrorCode;
  33. - (BOOL) hadError;
  34. - (sqlite_int64) lastInsertRowId;
  35. - (sqlite3*) sqliteHandle;
  36. - (BOOL) executeUpdate:(NSString*)sql, ...;
  37. - (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
  38. - (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this. use the previous two instead.
  39. - (id) executeQuery:(NSString*)sql, ...;
  40. - (id) executeQuery:(NSString *)sql withArgumentsInArray:(NSArray *)arguments;
  41. - (BOOL) executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray*)arrayArgs orVAList:(va_list)args; // you shouldn't ever need to call this. use the previous two instead.
  42. - (BOOL) rollback;
  43. - (BOOL) commit;
  44. - (BOOL) beginTransaction;
  45. - (BOOL) beginDeferredTransaction;
  46. - (BOOL)logsErrors;
  47. - (void)setLogsErrors:(BOOL)flag;
  48. - (BOOL)crashOnErrors;
  49. - (void)setCrashOnErrors:(BOOL)flag;
  50. - (BOOL)inUse;
  51. - (void)setInUse:(BOOL)value;
  52. - (BOOL)inTransaction;
  53. - (void)setInTransaction:(BOOL)flag;
  54. - (BOOL)traceExecution;
  55. - (void)setTraceExecution:(BOOL)flag;
  56. - (BOOL)checkedOut;
  57. - (void)setCheckedOut:(BOOL)flag;
  58. - (int)busyRetryTimeout;
  59. - (void)setBusyRetryTimeout:(int)newBusyRetryTimeout;
  60. - (BOOL)shouldCacheStatements;
  61. - (void)setShouldCacheStatements:(BOOL)value;
  62. - (NSMutableDictionary *)cachedStatements;
  63. - (void)setCachedStatements:(NSMutableDictionary *)value;
  64. + (NSString*) sqliteLibVersion;
  65. - (int)changes;
  66. @end
  67. @interface FMStatement : NSObject {
  68. sqlite3_stmt *statement;
  69. NSString *query;
  70. long useCount;
  71. }
  72. - (void) close;
  73. - (void) reset;
  74. - (sqlite3_stmt *)statement;
  75. - (void)setStatement:(sqlite3_stmt *)value;
  76. - (NSString *)query;
  77. - (void)setQuery:(NSString *)value;
  78. - (long)useCount;
  79. - (void)setUseCount:(long)value;
  80. @end