do_sqlite3 0.2.5 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -2
- data/Rakefile +46 -25
- data/TODO +4 -0
- data/ext/do_sqlite3_ext.c +538 -0
- data/ext/extconf.rb +28 -4
- data/lib/do_sqlite3.rb +4 -209
- data/lib/do_sqlite3/transaction.rb +36 -0
- data/spec/integration/do_sqlite3_spec.rb +244 -0
- data/spec/integration/logging_spec.rb +47 -0
- data/spec/integration/quoting_spec.rb +19 -0
- data/spec/spec_helper.rb +47 -0
- data/spec/unit/transaction_spec.rb +34 -0
- metadata +60 -48
- data/ext/sqlite3_c.c +0 -4725
- data/ext/sqlite_c.i +0 -168
data/ext/sqlite_c.i
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
%module sqlite3_c
|
2
|
-
%include "typemaps.i"
|
3
|
-
%{
|
4
|
-
#include <sqlite3.h>
|
5
|
-
typedef void BLOB;
|
6
|
-
typedef void VALBLOB;
|
7
|
-
%}
|
8
|
-
|
9
|
-
%typemap(in,numinputs=0) sqlite3 **OUTPUT(sqlite3 *) {
|
10
|
-
$1 = (sqlite3**)malloc( sizeof( sqlite3* ) );
|
11
|
-
};
|
12
|
-
%typemap(argout,fragment="output_helper") sqlite3 **OUTPUT (sqlite3 *) {
|
13
|
-
$result = output_helper($result, SWIG_NewPointerObj( *$1, SWIGTYPE_p_sqlite3, 0 ));
|
14
|
-
}
|
15
|
-
%typemap(freearg) sqlite3 ** {
|
16
|
-
free((sqlite3 *)$1);
|
17
|
-
}
|
18
|
-
|
19
|
-
%typemap(in,numinputs=0) sqlite3_stmt **OUTPUT(sqlite3_stmt *) {
|
20
|
-
$1 = (sqlite3_stmt**)malloc( sizeof( sqlite3_stmt* ) );
|
21
|
-
};
|
22
|
-
%typemap(argout,fragment="output_helper") sqlite3_stmt **OUTPUT (sqlite3_stmt *) {
|
23
|
-
$result = output_helper($result, SWIG_NewPointerObj( *$1, SWIGTYPE_p_sqlite3_stmt, 0 ));
|
24
|
-
}
|
25
|
-
%typemap(freearg) sqlite3_stmt ** {
|
26
|
-
free((sqlite3_stmt *)$1);
|
27
|
-
}
|
28
|
-
|
29
|
-
%typemap(in,numinputs=0) char **OUTPUT(char *) {
|
30
|
-
$1 = (char**)malloc( sizeof( char* ) );
|
31
|
-
};
|
32
|
-
%typemap(argout,fragment="output_helper") char **OUTPUT (char *) {
|
33
|
-
$result = output_helper($result, rb_str_new2(*$1));
|
34
|
-
}
|
35
|
-
%typemap(freearg) char ** {
|
36
|
-
free((char *)$1);
|
37
|
-
}
|
38
|
-
|
39
|
-
%typemap(out) sqlite_int64 {
|
40
|
-
$result = LONG2NUM(result);
|
41
|
-
}
|
42
|
-
|
43
|
-
const char *sqlite3_libversion(void);
|
44
|
-
int sqlite3_close(sqlite3*);
|
45
|
-
|
46
|
-
sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
|
47
|
-
|
48
|
-
int sqlite3_changes(sqlite3*);
|
49
|
-
int sqlite3_total_changes(sqlite3*);
|
50
|
-
void sqlite3_interrupt(sqlite3*);
|
51
|
-
|
52
|
-
int sqlite3_complete(const char*);
|
53
|
-
int sqlite3_complete16(const void *str);
|
54
|
-
|
55
|
-
int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
|
56
|
-
int sqlite3_busy_timeout(sqlite3*,int);
|
57
|
-
int sqlite3_set_authorizer(sqlite3*, int(*)(void*,int,const char*,const char*,const char*,const char*), void*);
|
58
|
-
int sqlite3_trace(sqlite3*, void(*)(void*,const char*), void*);
|
59
|
-
|
60
|
-
int sqlite3_open(const char *filename, sqlite3 **OUTPUT);
|
61
|
-
int sqlite3_open16(const void *filename, sqlite3 **);
|
62
|
-
|
63
|
-
int sqlite3_errcode(sqlite3*);
|
64
|
-
const char *sqlite3_errmsg(sqlite3*);
|
65
|
-
const void *sqlite3_errmsg16(sqlite3*);
|
66
|
-
|
67
|
-
int sqlite3_prepare(sqlite3*,const char* sql,int,sqlite3_stmt**OUTPUT,const char**OUTPUT);
|
68
|
-
int sqlite3_prepare_v2(sqlite3*,const char* sql,int,sqlite3_stmt**OUTPUT,const char**OUTPUT);
|
69
|
-
int sqlite3_prepare16(sqlite3*,const void* sql,int,sqlite3_stmt**,const void**);
|
70
|
-
|
71
|
-
int sqlite3_bind_blob(sqlite3_stmt*,int,const void *blob,int,void(*free)(void*));
|
72
|
-
int sqlite3_bind_double(sqlite3_stmt*,int,double);
|
73
|
-
int sqlite3_bind_int(sqlite3_stmt*,int,int);
|
74
|
-
int sqlite3_bind_int64(sqlite3_stmt*,int,sqlite_int64);
|
75
|
-
int sqlite3_bind_null(sqlite3_stmt*,int);
|
76
|
-
int sqlite3_bind_text(sqlite3_stmt*,int,const char*text,int,void(*free)(void*));
|
77
|
-
int sqlite3_bind_text16(sqlite3_stmt*,int,const void*utf16,int,void(*free)(void*));
|
78
|
-
|
79
|
-
int sqlite3_bind_parameter_count(sqlite3_stmt*);
|
80
|
-
const char *sqlite3_bind_parameter_name(sqlite3_stmt*,int);
|
81
|
-
int sqlite3_bind_parameter_index(sqlite3_stmt*,const char*);
|
82
|
-
|
83
|
-
int sqlite3_column_count(sqlite3_stmt*);
|
84
|
-
const char *sqlite3_column_name(sqlite3_stmt*,int);
|
85
|
-
const void *sqlite3_column_name16(sqlite3_stmt*,int);
|
86
|
-
const char *sqlite3_column_decltype(sqlite3_stmt*,int);
|
87
|
-
const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
|
88
|
-
|
89
|
-
int sqlite3_step(sqlite3_stmt*);
|
90
|
-
|
91
|
-
int sqlite3_data_count(sqlite3_stmt*);
|
92
|
-
|
93
|
-
const BLOB *sqlite3_column_blob(sqlite3_stmt*,int);
|
94
|
-
int sqlite3_column_bytes(sqlite3_stmt*,int);
|
95
|
-
int sqlite3_column_bytes16(sqlite3_stmt*,int);
|
96
|
-
double sqlite3_column_double(sqlite3_stmt*,int);
|
97
|
-
double sqlite3_column_int(sqlite3_stmt*,int);
|
98
|
-
sqlite_int64 sqlite3_column_int64(sqlite3_stmt*,int);
|
99
|
-
const char *sqlite3_column_text(sqlite3_stmt*,int);
|
100
|
-
const void *sqlite3_column_text16(sqlite3_stmt*,int);
|
101
|
-
int sqlite3_column_type(sqlite3_stmt*,int);
|
102
|
-
|
103
|
-
int sqlite3_finalize(sqlite3_stmt*);
|
104
|
-
int sqlite3_reset(sqlite3_stmt*);
|
105
|
-
|
106
|
-
int sqlite3_create_function(sqlite3*,const char*str,int,int,void*,void(*func)(sqlite3_context*,int,sqlite3_value**),void(*step)(sqlite3_context*,int,sqlite3_value**),void(*final)(sqlite3_context*));
|
107
|
-
|
108
|
-
int sqlite3_create_function16(sqlite3*,const void*str,int,int,void*,void(*func)(sqlite3_context*,int,sqlite3_value**),void(*step)(sqlite3_context*,int,sqlite3_value**),void(*final)(sqlite3_context*));
|
109
|
-
|
110
|
-
int sqlite3_aggregate_count(sqlite3_context*);
|
111
|
-
|
112
|
-
const VALBLOB *sqlite3_value_blob(sqlite3_value*);
|
113
|
-
int sqlite3_value_bytes(sqlite3_value*);
|
114
|
-
int sqlite3_value_bytes16(sqlite3_value*);
|
115
|
-
double sqlite3_value_double(sqlite3_value*);
|
116
|
-
int sqlite3_value_int(sqlite3_value*);
|
117
|
-
sqlite_int64 sqlite3_value_int64(sqlite3_value*);
|
118
|
-
const char *sqlite3_value_text(sqlite3_value*);
|
119
|
-
const void *sqlite3_value_text16(sqlite3_value*);
|
120
|
-
const void *sqlite3_value_text16le(sqlite3_value*);
|
121
|
-
const void *sqlite3_value_text16be(sqlite3_value*);
|
122
|
-
int sqlite3_value_type(sqlite3_value*);
|
123
|
-
|
124
|
-
void sqlite3_result_blob(sqlite3_context*,const void *blob,int,void(*free)(void*));
|
125
|
-
void sqlite3_result_double(sqlite3_context*,double);
|
126
|
-
void sqlite3_result_error(sqlite3_context*,const char *text,int);
|
127
|
-
void sqlite3_result_error16(sqlite3_context*,const void *blob,int);
|
128
|
-
void sqlite3_result_int(sqlite3_context*,int);
|
129
|
-
void sqlite3_result_int64(sqlite3_context*,sqlite_int64);
|
130
|
-
void sqlite3_result_text(sqlite3_context*,const char* text,int,void(*free)(void*));
|
131
|
-
void sqlite3_result_text16(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
132
|
-
void sqlite3_result_text16le(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
133
|
-
void sqlite3_result_text16be(sqlite3_context*,const void* utf16,int,void(*free)(void*));
|
134
|
-
void sqlite3_result_value(sqlite3_context*,sqlite3_value*);
|
135
|
-
|
136
|
-
VALUE *sqlite3_aggregate_context(sqlite3_context*,int data_size);
|
137
|
-
|
138
|
-
#define SQLITE_OK 0 /* Successful result */
|
139
|
-
/* beginning-of-error-codes */
|
140
|
-
#define SQLITE_ERROR 1 /* SQL error or missing database */
|
141
|
-
#define SQLITE_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
|
142
|
-
#define SQLITE_PERM 3 /* Access permission denied */
|
143
|
-
#define SQLITE_ABORT 4 /* Callback routine requested an abort */
|
144
|
-
#define SQLITE_BUSY 5 /* The database file is locked */
|
145
|
-
#define SQLITE_LOCKED 6 /* A table in the database is locked */
|
146
|
-
#define SQLITE_NOMEM 7 /* A malloc() failed */
|
147
|
-
#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
|
148
|
-
#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
|
149
|
-
#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
|
150
|
-
#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
|
151
|
-
#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
|
152
|
-
#define SQLITE_FULL 13 /* Insertion failed because database is full */
|
153
|
-
#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
|
154
|
-
#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */
|
155
|
-
#define SQLITE_EMPTY 16 /* Database is empty */
|
156
|
-
#define SQLITE_SCHEMA 17 /* The database schema changed */
|
157
|
-
#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
|
158
|
-
#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */
|
159
|
-
#define SQLITE_MISMATCH 20 /* Data type mismatch */
|
160
|
-
#define SQLITE_MISUSE 21 /* Library used incorrectly */
|
161
|
-
#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
|
162
|
-
#define SQLITE_AUTH 23 /* Authorization denied */
|
163
|
-
#define SQLITE_FORMAT 24 /* Auxiliary database format error */
|
164
|
-
#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
|
165
|
-
#define SQLITE_NOTADB 26 /* File opened that is not a database file */
|
166
|
-
#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
|
167
|
-
#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
|
168
|
-
/* end-of-error-codes */
|