sqlite3-ruby 0.6.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sqlite3-ruby might be problematic. Click here for more details.

@@ -62,25 +62,25 @@
62
62
  <ul>
63
63
  <li>How do I do a database query?
64
64
  <ul>
65
- <li><a href='#538646076'>I just want an array of the rows&#8230;</a></li>
66
- <li><a href='#538646036'>I&#8217;d like to use a block to iterate through the rows&#8230;</a></li>
67
- <li><a href='#538645996'>I need to get the column names as well as the rows&#8230;</a></li>
68
- <li><a href='#538645956'>I just want the first row of the result set&#8230;</a></li>
69
- <li><a href='#538645916'>I just want the first value of the first row of the result set&#8230;</a></li>
65
+ <li><a href='#538671086'>I just want an array of the rows&#8230;</a></li>
66
+ <li><a href='#538671046'>I&#8217;d like to use a block to iterate through the rows&#8230;</a></li>
67
+ <li><a href='#538671006'>I need to get the column names as well as the rows&#8230;</a></li>
68
+ <li><a href='#538670966'>I just want the first row of the result set&#8230;</a></li>
69
+ <li><a href='#538670926'>I just want the first value of the first row of the result set&#8230;</a></li>
70
70
  </ul>
71
71
  </li>
72
- <li><a href='#538645846'>How do I prepare a statement for repeated execution?</a></li>
73
- <li><a href='#538645806'>How do I use placeholders in an <span class="caps">SQL</span> statement?</a></li>
74
- <li><a href='#538645766'>How do I discover metadata about a query?</a></li>
75
- <li><a href='#538645726'>I&#8217;d like the rows to be indexible by column name.</a></li>
76
- <li><a href='#538645686'>I&#8217;d like the values from a query to be the correct types, instead of String.</a></li>
77
- <li><a href='#538645646'>How do insert binary data into the database?</a></li>
78
- <li><a href='#538645606'>How do I do a <span class="caps">DDL </span>(insert, update, delete) statement?</a></li>
79
- <li><a href='#538645566'>How do I execute multiple statements in a single string?</a></li>
80
- <li><a href='#538645526'>How do I begin/end a transaction?</a></li>
72
+ <li><a href='#538670856'>How do I prepare a statement for repeated execution?</a></li>
73
+ <li><a href='#538670816'>How do I use placeholders in an <span class="caps">SQL</span> statement?</a></li>
74
+ <li><a href='#538670776'>How do I discover metadata about a query?</a></li>
75
+ <li><a href='#538670736'>I&#8217;d like the rows to be indexible by column name.</a></li>
76
+ <li><a href='#538670696'>I&#8217;d like the values from a query to be the correct types, instead of String.</a></li>
77
+ <li><a href='#538670656'>How do insert binary data into the database?</a></li>
78
+ <li><a href='#538670616'>How do I do a <span class="caps">DDL </span>(insert, update, delete) statement?</a></li>
79
+ <li><a href='#538670576'>How do I execute multiple statements in a single string?</a></li>
80
+ <li><a href='#538670536'>How do I begin/end a transaction?</a></li>
81
81
  </ul>
82
82
  </div>
83
- <a name='538646076'></a>
83
+ <a name='538671086'></a>
84
84
  <div class='faq-title'>How do I do a database query? I just want an array of the rows&#8230;</div>
85
85
  <div class='faq-answer'><p>Use the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a> method. If you don&#8217;t give it a block, it will return an array of all the rows:</p>
86
86
 
@@ -91,7 +91,7 @@
91
91
  db = SQLite3::<a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database</a>.new( "test.db" )
92
92
  rows = db.execute( "select * from test" )
93
93
  </pre></div>
94
- <a name='538646036'></a>
94
+ <a name='538671046'></a>
95
95
  <div class='faq-title'>How do I do a database query? I&#8217;d like to use a block to iterate through the rows&#8230;</div>
96
96
  <div class='faq-answer'><p>Use the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a> method. If you give it a block, each row of the result will be yielded to the block:</p>
97
97
 
@@ -104,7 +104,7 @@
104
104
  ...
105
105
  end
106
106
  </pre></div>
107
- <a name='538645996'></a>
107
+ <a name='538671006'></a>
108
108
  <div class='faq-title'>How do I do a database query? I need to get the column names as well as the rows&#8230;</div>
109
109
  <div class='faq-answer'><p>Use the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute2</a> method. This works just like <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a>; if you don&#8217;t give it a block, it returns an array of rows; otherwise, it will yield each row to the block. <em>However</em>, the first row returned is always an array of the column names from the query:</p>
110
110
 
@@ -126,7 +126,7 @@
126
126
  end
127
127
  end
128
128
  </pre></div>
129
- <a name='538645956'></a>
129
+ <a name='538670966'></a>
130
130
  <div class='faq-title'>How do I do a database query? I just want the first row of the result set&#8230;</div>
131
131
  <div class='faq-answer'><p>Easy. Just call <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#get_first_row</a>:</p>
132
132
 
@@ -135,7 +135,7 @@
135
135
  row = db.get_first_row( "select * from table" )
136
136
  </pre>
137
137
  <p>This also supports bind variables, just like <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a> and friends.</p></div>
138
- <a name='538645916'></a>
138
+ <a name='538670926'></a>
139
139
  <div class='faq-title'>How do I do a database query? I just want the first value of the first row of the result set&#8230;</div>
140
140
  <div class='faq-answer'><p>Also easy. Just call <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#get_first_value</a>:</p>
141
141
 
@@ -144,7 +144,7 @@
144
144
  count = db.get_first_value( "select count(*) from table" )
145
145
  </pre>
146
146
  <p>This also supports bind variables, just like <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a> and friends.</p></div>
147
- <a name='538645846'></a>
147
+ <a name='538670856'></a>
148
148
  <div class='faq-title'>How do I prepare a statement for repeated execution?</div>
149
149
  <div class='faq-answer'><p>If the same statement is going to be executed repeatedly, you can speed things up a bit by <em>preparing</em> the statement. You do this via the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#prepare</a> method. It returns a <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Statement.html'>Statement</a> object, and you can then invoke #execute on that to get the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/ResultSet.html'>ResultSet</a>:</p>
150
150
 
@@ -171,7 +171,7 @@
171
171
  end
172
172
  </pre>
173
173
  <p>This is made more useful by the ability to bind variables to placeholders via the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Statement.html'>Statement#bind_param</a> and <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Statement.html'>Statement#bind_params</a> methods. (See the next <span class="caps">FAQ</span> for details.)</p></div>
174
- <a name='538645806'></a>
174
+ <a name='538670816'></a>
175
175
  <div class='faq-title'>How do I use placeholders in an <span class="caps">SQL</span> statement?</div>
176
176
  <div class='faq-answer'><p>Placeholders in an <span class="caps">SQL</span> statement take any of the following formats:</p>
177
177
  <ul>
@@ -235,7 +235,7 @@
235
235
 
236
236
  stmt.bind_params( "value", "name" =&gt; "bob" )
237
237
  </pre></div>
238
- <a name='538645766'></a>
238
+ <a name='538670776'></a>
239
239
  <div class='faq-title'>How do I discover metadata about a query?</div>
240
240
  <div class='faq-answer'><p>If you ever want to know the names or types of the columns in a result set, you can do it in several ways.</p>
241
241
 
@@ -265,7 +265,7 @@
265
265
  p stmt.columns
266
266
  p stmt.types
267
267
  </pre></div>
268
- <a name='538645726'></a>
268
+ <a name='538670736'></a>
269
269
  <div class='faq-title'>I&#8217;d like the rows to be indexible by column name.</div>
270
270
  <div class='faq-answer'><p>By default, each row from a query is returned as an Array of values. This means that you can only obtain values by their index. Sometimes, however, you would like to obtain values by their column name.</p>
271
271
 
@@ -291,7 +291,7 @@
291
291
  p row[1] == row['column2']
292
292
  end
293
293
  </pre></div>
294
- <a name='538645686'></a>
294
+ <a name='538670696'></a>
295
295
  <div class='faq-title'>I&#8217;d like the values from a query to be the correct types, instead of String.</div>
296
296
  <div class='faq-answer'><p>You can turn on &#8220;type translation&#8221; by setting <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#type_translation</a> to true:</p>
297
297
 
@@ -327,7 +327,7 @@
327
327
  obj = db.get_first_value( "select thing from objects where name='bob'" )
328
328
  p obj == h
329
329
  </pre></div>
330
- <a name='538645646'></a>
330
+ <a name='538670656'></a>
331
331
  <div class='faq-title'>How do insert binary data into the database?</div>
332
332
  <div class='faq-answer'><p>Use blobs. Blobs are new features of SQLite3. You have to use bind variables to make it work:</p>
333
333
 
@@ -338,7 +338,7 @@
338
338
  SQLite3::Blob.new( "a\0b\0c\0d ) )
339
339
  </pre>
340
340
  <p>The blob values must be indicated explicitly by binding each parameter to a value of type SQLite3::Blob.</p></div>
341
- <a name='538645606'></a>
341
+ <a name='538670616'></a>
342
342
  <div class='faq-title'>How do I do a <span class="caps">DDL </span>(insert, update, delete) statement?</div>
343
343
  <div class='faq-answer'><p>You can actually do inserts, updates, and deletes in exactly the same way as selects, but in general the <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a> method will be most convenient:</p>
344
344
 
@@ -346,7 +346,7 @@
346
346
  <pre>
347
347
  db.execute( "insert into table values ( ?, ? )", *bind_vars )
348
348
  </pre></div>
349
- <a name='538645566'></a>
349
+ <a name='538670576'></a>
350
350
  <div class='faq-title'>How do I execute multiple statements in a single string?</div>
351
351
  <div class='faq-answer'><p>The standard query methods (<a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute</a>, <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute2</a>, <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#query</a>, and <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Statement.html'>Statement#execute</a>) will only execute the first statement in the string that is given to them. Thus, if you have a string with multiple <span class="caps">SQL</span> statements, each separated by a string, you can&#8217;t use those methods to execute them all at once.</p>
352
352
 
@@ -368,7 +368,7 @@
368
368
  db.execute_batch( sql )
369
369
  </pre>
370
370
  <p>Unlike the other query methods, <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#execute_batch</a> accepts no block. It will also only ever return <ins>nil</ins>. Thus, it is really only suitable for batch processing of <span class="caps">DDL</span> statements.</p></div>
371
- <a name='538645526'></a>
371
+ <a name='538670536'></a>
372
372
  <div class='faq-title'>How do I begin/end a transaction?</div>
373
373
  <div class='faq-answer'><p>Use <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#transaction</a> to start a transaction. If you give it a block, the block will be automatically committed at the end of the block, unless an exception was raised, in which case the transaction will be rolled back. (Never explicitly call <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#commit</a> or <a href='http://sqlite-ruby.rubyforge.org/classes/SQLite/Database.html'>Database#rollback</a> inside of a transaction block&#8212;you&#8217;ll get errors when the block terminates!)</p>
374
374
 
@@ -0,0 +1,4 @@
1
+ extconf.rb
2
+ post-clean.rb
3
+ post-distclean.rb
4
+ sqlite3_api.i
@@ -0,0 +1,8 @@
1
+ require 'mkmf'
2
+
3
+ dir_config( "sqlite3" )
4
+
5
+ if have_header( "sqlite3.h" ) and have_library( "sqlite3", "sqlite3_open" )
6
+ system "swig -ruby sqlite3_api.i"
7
+ create_makefile( "sqlite3_api" )
8
+ end
@@ -0,0 +1,3 @@
1
+ # post-distclean.rb
2
+
3
+ File.delete File.join( curr_srcdir, "sqlite3_api_wrap.c" ) rescue nil
@@ -0,0 +1,4 @@
1
+ # post-distclean.rb
2
+
3
+ # on a distclean, always do a clean, as well
4
+ eval File.read( File.join( curr_srcdir, "post-clean.rb" ) )
@@ -0,0 +1,339 @@
1
+ %module "SQLite3::driver::native::API"
2
+ %include "typemaps.i"
3
+ %{
4
+ #include <sqlite3.h>
5
+ #include "ruby.h"
6
+ #include "intern.h"
7
+
8
+ #define Init_API Init_sqlite3_api
9
+
10
+ struct CallbackData {
11
+ VALUE proc;
12
+ VALUE proc2;
13
+ VALUE data;
14
+ };
15
+
16
+ typedef struct CallbackData CallbackData;
17
+ typedef void BLOB;
18
+ typedef void VALBLOB;
19
+
20
+ int Sqlite3_ruby_busy_handler(void* data,int value) {
21
+ VALUE result;
22
+ CallbackData *cb = (CallbackData*)data;
23
+ result = rb_funcall(
24
+ cb->proc, rb_intern("call"), 2, cb->data, INT2FIX(value) );
25
+ return FIX2INT(result);
26
+ }
27
+
28
+ int Sqlite3_ruby_authorizer(void* data,int type,
29
+ const char* a,const char* b,const char* c,const char* d)
30
+ {
31
+ VALUE result;
32
+ CallbackData *cb = (CallbackData*)data;
33
+ result = rb_funcall(
34
+ cb->proc, rb_intern("call"), 6, cb->data, INT2FIX(type),
35
+ ( a ? rb_str_new2(a) : Qnil ), ( b ? rb_str_new2(b) : Qnil ),
36
+ ( c ? rb_str_new2(c) : Qnil ), ( d ? rb_str_new2(d) : Qnil ) );
37
+ return FIX2INT(result);
38
+ }
39
+
40
+ void Sqlite3_ruby_trace(void* data, const char *sql) {
41
+ CallbackData *cb = (CallbackData*)data;
42
+ rb_funcall( cb->proc, rb_intern("call"), 2, cb->data,
43
+ sql ? rb_str_new2(sql) : Qnil );
44
+ }
45
+
46
+ void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
47
+ sqlite3_value** args)
48
+ {
49
+ CallbackData *data;
50
+ VALUE rb_args;
51
+ VALUE *rb_context;
52
+ int idx;
53
+
54
+ data = (CallbackData*)sqlite3_user_data(ctx);
55
+
56
+ if( data->proc2 != Qnil ) {
57
+ rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
58
+ if( *rb_context == 0 ) {
59
+ *rb_context = rb_hash_new();
60
+ rb_gc_register_address( rb_context );
61
+ }
62
+ }
63
+
64
+ rb_args = rb_ary_new2(n+1);
65
+ rb_ary_push( rb_args, SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
66
+ for( idx = 0; idx < n; idx++ ) {
67
+ rb_ary_push( rb_args, SWIG_NewPointerObj(args[idx],
68
+ SWIGTYPE_p_sqlite3_value,0) );
69
+ }
70
+
71
+ rb_apply( data->proc, rb_intern("call"), rb_args );
72
+ }
73
+
74
+ void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
75
+ VALUE *rb_context;
76
+ CallbackData *data;
77
+
78
+ rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
79
+ if( *rb_context == 0 ) {
80
+ *rb_context = rb_hash_new();
81
+ rb_gc_register_address( rb_context );
82
+ }
83
+
84
+ data = (CallbackData*)sqlite3_user_data(ctx);
85
+
86
+ rb_funcall( data->proc2, rb_intern("call"), 1,
87
+ SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
88
+
89
+ rb_gc_unregister_address( rb_context );
90
+ }
91
+ %}
92
+
93
+ struct CallbackData {
94
+ VALUE proc;
95
+ VALUE proc2;
96
+ VALUE data;
97
+ };
98
+
99
+ %typemap(in) const void *str {
100
+ $1 = (void*)RSTRING($input)->ptr;
101
+ }
102
+
103
+ %typemap(in) (const char *filename, sqlite3**) {
104
+ $1 = STR2CSTR($input);
105
+ $2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
106
+ }
107
+
108
+ %typemap(argout) (const char *filename, sqlite3**) {
109
+ VALUE ary;
110
+ ary = rb_ary_new2(2);
111
+ rb_ary_push( ary, $result );
112
+ rb_ary_push( ary, SWIG_NewPointerObj( *$2, SWIGTYPE_p_sqlite3, 0 ) );
113
+ free( $2 );
114
+ $result = ary;
115
+ }
116
+
117
+ %typemap(in) (const void *filename, sqlite3**) {
118
+ $1 = (void*)RSTRING($input)->ptr;
119
+ $2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
120
+ }
121
+
122
+ %typemap(argout) (const void *filename, sqlite3**) {
123
+ VALUE ary;
124
+ ary = rb_ary_new2(2);
125
+ rb_ary_push( ary, $result );
126
+ rb_ary_push( ary, SWIG_NewPointerObj( *$2, SWIGTYPE_p_sqlite3, 0 ) );
127
+ free( $2 );
128
+ $result = ary;
129
+ }
130
+
131
+ typedef void BLOB;
132
+ %typemap(out) const BLOB * {
133
+ $result = $1 ?
134
+ rb_str_new( (char*)$1, sqlite3_column_bytes( arg1, arg2 ) ) : Qnil;
135
+ }
136
+
137
+ typedef void VALBLOB;
138
+ %typemap(out) const VALBLOB * {
139
+ $result = $1 ? rb_str_new( (char*)$1, sqlite3_value_bytes( arg1 ) ) : Qnil;
140
+ }
141
+
142
+ %typemap(out) const void * {
143
+ int i;
144
+ if( $1 ) {
145
+ for( i = 0; ((char*)$1)[i]; i += 2 );
146
+ $result = rb_str_new( (char*)$1, i );
147
+ } else $result = Qnil;
148
+ }
149
+
150
+ %typemap(in) (const char * sql,int,sqlite3_stmt**,const char**) (sqlite3_stmt *stmt, char *errmsg) {
151
+ $1 = RSTRING($input)->ptr;
152
+ $2 = RSTRING($input)->len;
153
+ $3 = &stmt2;
154
+ $4 = &errmsg2;
155
+ }
156
+
157
+ %typemap(argout) (const char* sql,int,sqlite3_stmt**,const char**) {
158
+ VALUE ary;
159
+ ary = rb_ary_new2(3);
160
+ rb_ary_push( ary, $result );
161
+ rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
162
+ rb_ary_push( ary, errmsg2 ? rb_str_new2( errmsg2 ) : Qnil );
163
+ $result = ary;
164
+ }
165
+
166
+ %typemap(in) (const void* sql,int,sqlite3_stmt**,const void**) (sqlite3_stmt *stmt, void *errmsg) {
167
+ $1 = RSTRING($input)->ptr;
168
+ $2 = RSTRING($input)->len;
169
+ $3 = &stmt2;
170
+ $4 = &errmsg2;
171
+ }
172
+
173
+ %typemap(argout) (const void* sql,int,sqlite3_stmt**,const void**) {
174
+ VALUE ary;
175
+ int i;
176
+
177
+ for( i = 0; ((char*)errmsg2)[i]; i += 2 );
178
+
179
+ ary = rb_ary_new2(3);
180
+ rb_ary_push( ary, $result );
181
+ rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
182
+ rb_ary_push( ary, errmsg2 ? rb_str_new( (char*)errmsg2, i ) : Qnil );
183
+ $result = ary;
184
+ }
185
+
186
+ %typemap(in) (const void *blob,int) {
187
+ $1 = (void*)RSTRING($input)->ptr;
188
+ $2 = RSTRING($input)->len;
189
+ }
190
+
191
+ %typemap(in) (const void *blob,int,void(*free)(void*)) {
192
+ $1 = (void*)RSTRING($input)->ptr;
193
+ $2 = RSTRING($input)->len;
194
+ $3 = SQLITE_TRANSIENT;
195
+ }
196
+
197
+ %typemap(in) (const char *text,int) {
198
+ $1 = RSTRING($input)->ptr;
199
+ $2 = RSTRING($input)->len;
200
+ }
201
+
202
+ %typemap(in) (const char *text,int,void(*free)(void*)) {
203
+ $1 = RSTRING($input)->ptr;
204
+ $2 = RSTRING($input)->len;
205
+ $3 = SQLITE_TRANSIENT;
206
+ }
207
+
208
+ %typemap(in) (const void *utf16,int) {
209
+ $1 = (void*)RSTRING($input)->ptr;
210
+ $2 = RSTRING($input)->len;
211
+ }
212
+
213
+ %typemap(in) (const void *utf16,int,void(*free)(void*)) {
214
+ $1 = (void*)RSTRING($input)->ptr;
215
+ $2 = RSTRING($input)->len;
216
+ $3 = SQLITE_TRANSIENT;
217
+ }
218
+
219
+ %typemap(out) sqlite_int64 {
220
+ $result = rb_ll2inum( $1 );
221
+ }
222
+
223
+ %typemap(out) const char * {
224
+ $result = $1 ? rb_str_new2($1) : Qnil;
225
+ }
226
+
227
+ %typemap(in) sqlite_int64 {
228
+ $1 = rb_big2ll( $input );
229
+ }
230
+
231
+ %typemap(in) (sqlite3_context*,int data_size) {
232
+ SWIG_ConvertPtr($input,(void**)&$1, SWIGTYPE_p_sqlite3_context, 1);
233
+ $2 = 4;
234
+ }
235
+
236
+ %typemap(out) VALUE* {
237
+ $result = *(VALUE*)$1;
238
+ }
239
+
240
+ %constant int Sqlite3_ruby_busy_handler(void*,int);
241
+ %constant int Sqlite3_ruby_authorizer(void*,int,const char*,const char*,const char*,const char*);
242
+ %constant void Sqlite3_ruby_trace(void*,const char*);
243
+ %constant void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
244
+ sqlite3_value** args);
245
+ %constant void Sqlite3_ruby_function_final(sqlite3_context* ctx);
246
+
247
+ const char *sqlite3_libversion(void);
248
+ int sqlite3_close(sqlite3*);
249
+
250
+ sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
251
+
252
+ int sqlite3_changes(sqlite3*);
253
+ int sqlite3_total_changes(sqlite3*);
254
+ void sqlite3_interrupt(sqlite3*);
255
+
256
+ int sqlite3_complete(const char*);
257
+ int sqlite3_complete16(const void *str);
258
+
259
+ int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
260
+ int sqlite3_busy_timeout(sqlite3*,int);
261
+ int sqlite3_set_authorizer(sqlite3*, int(*)(void*,int,const char*,const char*,const char*,const char*), void*);
262
+ int sqlite3_trace(sqlite3*, void(*)(void*,const char*), void*);
263
+
264
+ int sqlite3_open(const char *filename, sqlite3 **);
265
+ int sqlite3_open16(const void *filename, sqlite3 **);
266
+
267
+ int sqlite3_errcode(sqlite3*);
268
+ const char *sqlite3_errmsg(sqlite3*);
269
+ const void *sqlite3_errmsg16(sqlite3*);
270
+
271
+ int sqlite3_prepare(sqlite3*,const char* sql,int,sqlite3_stmt**,const char**);
272
+ int sqlite3_prepare16(sqlite3*,const void* sql,int,sqlite3_stmt**,const void**);
273
+
274
+ int sqlite3_bind_blob(sqlite3_stmt*,int,const void *blob,int,void(*free)(void*));
275
+ int sqlite3_bind_double(sqlite3_stmt*,int,double);
276
+ int sqlite3_bind_int(sqlite3_stmt*,int,int);
277
+ int sqlite3_bind_int64(sqlite3_stmt*,int,sqlite_int64);
278
+ int sqlite3_bind_null(sqlite3_stmt*,int);
279
+ int sqlite3_bind_text(sqlite3_stmt*,int,const char*text,int,void(*free)(void*));
280
+ int sqlite3_bind_text16(sqlite3_stmt*,int,const void*utf16,int,void(*free)(void*));
281
+
282
+ int sqlite3_bind_parameter_count(sqlite3_stmt*);
283
+ const char *sqlite3_bind_parameter_name(sqlite3_stmt*,int);
284
+ int sqlite3_bind_parameter_index(sqlite3_stmt*,const char*);
285
+
286
+ int sqlite3_column_count(sqlite3_stmt*);
287
+ const char *sqlite3_column_name(sqlite3_stmt*,int);
288
+ const void *sqlite3_column_name16(sqlite3_stmt*,int);
289
+ const char *sqlite3_column_decltype(sqlite3_stmt*,int);
290
+ const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
291
+
292
+ int sqlite3_step(sqlite3_stmt*);
293
+
294
+ int sqlite3_data_count(sqlite3_stmt*);
295
+
296
+ const BLOB *sqlite3_column_blob(sqlite3_stmt*,int);
297
+ int sqlite3_column_bytes(sqlite3_stmt*,int);
298
+ int sqlite3_column_bytes16(sqlite3_stmt*,int);
299
+ double sqlite3_column_double(sqlite3_stmt*,int);
300
+ double sqlite3_column_int(sqlite3_stmt*,int);
301
+ sqlite_int64 sqlite3_column_int64(sqlite3_stmt*,int);
302
+ const char *sqlite3_column_text(sqlite3_stmt*,int);
303
+ const void *sqlite3_column_text16(sqlite3_stmt*,int);
304
+ int sqlite3_column_type(sqlite3_stmt*,int);
305
+
306
+ int sqlite3_finalize(sqlite3_stmt*);
307
+ int sqlite3_reset(sqlite3_stmt*);
308
+
309
+ 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*));
310
+
311
+ 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*));
312
+
313
+ int sqlite3_aggregate_count(sqlite3_context*);
314
+
315
+ const VALBLOB *sqlite3_value_blob(sqlite3_value*);
316
+ int sqlite3_value_bytes(sqlite3_value*);
317
+ int sqlite3_value_bytes16(sqlite3_value*);
318
+ double sqlite3_value_double(sqlite3_value*);
319
+ int sqlite3_value_int(sqlite3_value*);
320
+ sqlite_int64 sqlite3_value_int64(sqlite3_value*);
321
+ const char *sqlite3_value_text(sqlite3_value*);
322
+ const void *sqlite3_value_text16(sqlite3_value*);
323
+ const void *sqlite3_value_text16le(sqlite3_value*);
324
+ const void *sqlite3_value_text16be(sqlite3_value*);
325
+ int sqlite3_value_type(sqlite3_value*);
326
+
327
+ void sqlite3_result_blob(sqlite3_context*,const void *blob,int,void(*free)(void*));
328
+ void sqlite3_result_double(sqlite3_context*,double);
329
+ void sqlite3_result_error(sqlite3_context*,const char *text,int);
330
+ void sqlite3_result_error16(sqlite3_context*,const void *blob,int);
331
+ void sqlite3_result_int(sqlite3_context*,int);
332
+ void sqlite3_result_int64(sqlite3_context*,sqlite_int64);
333
+ void sqlite3_result_text(sqlite3_context*,const char* text,int,void(*free)(void*));
334
+ void sqlite3_result_text16(sqlite3_context*,const void* utf16,int,void(*free)(void*));
335
+ void sqlite3_result_text16le(sqlite3_context*,const void* utf16,int,void(*free)(void*));
336
+ void sqlite3_result_text16be(sqlite3_context*,const void* utf16,int,void(*free)(void*));
337
+ void sqlite3_result_value(sqlite3_context*,sqlite3_value*);
338
+
339
+ VALUE *sqlite3_aggregate_context(sqlite3_context*,int data_size);