Oops, defined the sqlite3_*_objc_object functions as "static" instead of "extern...
[ITFoundation.git] / ITSQLite3Database.h
1 /*
2  *      ITFoundation
3  *      ITSQLite3Database.h
4  *
5  *      Copyright (c) 2008 by iThink Software.
6  *      All Rights Reserved.
7  *
8  *      $Id$
9  *
10  */
11
12 #import <Foundation/Foundation.h>
13 #import <sqlite3.h>
14
15 extern int sqlite3_bind_objc_object(sqlite3_stmt *statement, int index, id object);
16 extern id sqlite3_column_objc_object(sqlite3_stmt *statement, int columnIndex);
17
18 @interface ITSQLite3Database : NSObject {
19         NSString *dbPath;
20         sqlite3 *db;
21 }
22
23 - (id)initWithPath:(NSString *)path;
24
25 - (BOOL)begin;
26 - (BOOL)beginTransaction;
27 - (BOOL)commit;
28 - (BOOL)commitTransaction;
29 - (BOOL)rollback;
30 - (BOOL)rollbackTransaction;
31
32 - (BOOL)executeQuery:(NSString *)query va_args:(va_list)args;
33 - (BOOL)executeQuery:(NSString *)query, ...;
34
35 - (NSDictionary *)fetchRow:(NSString *)query va_args:(va_list)args;
36 - (NSDictionary *)fetchRow:(NSString *)query, ...;
37
38 - (NSArray *)fetchTable:(NSString *)query va_args:(va_list)args;
39 - (NSArray *)fetchTable:(NSString *)query, ...;
40
41 @end