amalgalite 0.10.1-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/HISTORY +201 -0
  2. data/LICENSE +29 -0
  3. data/README +51 -0
  4. data/bin/amalgalite-pack +126 -0
  5. data/examples/a.rb +9 -0
  6. data/examples/blob.rb +88 -0
  7. data/examples/bootstrap.rb +36 -0
  8. data/examples/define_aggregate.rb +75 -0
  9. data/examples/define_function.rb +104 -0
  10. data/examples/gem-db.rb +94 -0
  11. data/examples/gems.db +0 -0
  12. data/examples/require_me.rb +11 -0
  13. data/examples/requires.rb +42 -0
  14. data/examples/schema-info.rb +34 -0
  15. data/ext/amalgalite/amalgalite3.c +290 -0
  16. data/ext/amalgalite/amalgalite3.h +151 -0
  17. data/ext/amalgalite/amalgalite3_blob.c +240 -0
  18. data/ext/amalgalite/amalgalite3_constants.c +221 -0
  19. data/ext/amalgalite/amalgalite3_database.c +1148 -0
  20. data/ext/amalgalite/amalgalite3_requires_bootstrap.c +210 -0
  21. data/ext/amalgalite/amalgalite3_statement.c +639 -0
  22. data/ext/amalgalite/extconf.rb +36 -0
  23. data/ext/amalgalite/gen_constants.rb +130 -0
  24. data/ext/amalgalite/sqlite3.c +106729 -0
  25. data/ext/amalgalite/sqlite3.h +5626 -0
  26. data/ext/amalgalite/sqlite3_options.h +4 -0
  27. data/ext/amalgalite/sqlite3ext.h +380 -0
  28. data/gemspec.rb +60 -0
  29. data/lib/amalgalite.rb +43 -0
  30. data/lib/amalgalite/1.8/amalgalite3.so +0 -0
  31. data/lib/amalgalite/1.9/amalgalite3.so +0 -0
  32. data/lib/amalgalite/aggregate.rb +67 -0
  33. data/lib/amalgalite/blob.rb +186 -0
  34. data/lib/amalgalite/boolean.rb +42 -0
  35. data/lib/amalgalite/busy_timeout.rb +47 -0
  36. data/lib/amalgalite/column.rb +97 -0
  37. data/lib/amalgalite/core_ext/kernel/require.rb +21 -0
  38. data/lib/amalgalite/database.rb +947 -0
  39. data/lib/amalgalite/function.rb +61 -0
  40. data/lib/amalgalite/index.rb +43 -0
  41. data/lib/amalgalite/packer.rb +226 -0
  42. data/lib/amalgalite/paths.rb +70 -0
  43. data/lib/amalgalite/profile_tap.rb +131 -0
  44. data/lib/amalgalite/progress_handler.rb +21 -0
  45. data/lib/amalgalite/requires.rb +120 -0
  46. data/lib/amalgalite/schema.rb +191 -0
  47. data/lib/amalgalite/sqlite3.rb +6 -0
  48. data/lib/amalgalite/sqlite3/constants.rb +80 -0
  49. data/lib/amalgalite/sqlite3/database/function.rb +48 -0
  50. data/lib/amalgalite/sqlite3/database/status.rb +68 -0
  51. data/lib/amalgalite/sqlite3/status.rb +60 -0
  52. data/lib/amalgalite/sqlite3/version.rb +37 -0
  53. data/lib/amalgalite/statement.rb +414 -0
  54. data/lib/amalgalite/table.rb +90 -0
  55. data/lib/amalgalite/taps.rb +2 -0
  56. data/lib/amalgalite/taps/console.rb +27 -0
  57. data/lib/amalgalite/taps/io.rb +71 -0
  58. data/lib/amalgalite/trace_tap.rb +35 -0
  59. data/lib/amalgalite/type_map.rb +63 -0
  60. data/lib/amalgalite/type_maps/default_map.rb +167 -0
  61. data/lib/amalgalite/type_maps/storage_map.rb +40 -0
  62. data/lib/amalgalite/type_maps/text_map.rb +22 -0
  63. data/lib/amalgalite/version.rb +37 -0
  64. data/lib/amalgalite/view.rb +26 -0
  65. data/spec/aggregate_spec.rb +169 -0
  66. data/spec/amalgalite_spec.rb +4 -0
  67. data/spec/blob_spec.rb +81 -0
  68. data/spec/boolean_spec.rb +23 -0
  69. data/spec/busy_handler.rb +165 -0
  70. data/spec/database_spec.rb +494 -0
  71. data/spec/default_map_spec.rb +87 -0
  72. data/spec/function_spec.rb +94 -0
  73. data/spec/integeration_spec.rb +111 -0
  74. data/spec/packer_spec.rb +60 -0
  75. data/spec/paths_spec.rb +28 -0
  76. data/spec/progress_handler_spec.rb +105 -0
  77. data/spec/requires_spec.rb +23 -0
  78. data/spec/rtree_spec.rb +71 -0
  79. data/spec/schema_spec.rb +120 -0
  80. data/spec/spec_helper.rb +27 -0
  81. data/spec/sqlite3/constants_spec.rb +65 -0
  82. data/spec/sqlite3/database_status_spec.rb +36 -0
  83. data/spec/sqlite3/status_spec.rb +18 -0
  84. data/spec/sqlite3/version_spec.rb +14 -0
  85. data/spec/sqlite3_spec.rb +53 -0
  86. data/spec/statement_spec.rb +161 -0
  87. data/spec/storage_map_spec.rb +41 -0
  88. data/spec/tap_spec.rb +59 -0
  89. data/spec/text_map_spec.rb +23 -0
  90. data/spec/type_map_spec.rb +17 -0
  91. data/spec/version_spec.rb +15 -0
  92. data/tasks/announce.rake +43 -0
  93. data/tasks/config.rb +107 -0
  94. data/tasks/distribution.rake +77 -0
  95. data/tasks/documentation.rake +32 -0
  96. data/tasks/extension.rake +141 -0
  97. data/tasks/rspec.rake +33 -0
  98. data/tasks/rubyforge.rake +59 -0
  99. data/tasks/utils.rb +80 -0
  100. metadata +237 -0
@@ -0,0 +1,4 @@
1
+ /*
2
+ * Compile time options that are turned on for the amalgalite extension
3
+ */
4
+ #define
@@ -0,0 +1,380 @@
1
+ /*
2
+ ** 2006 June 7
3
+ **
4
+ ** The author disclaims copyright to this source code. In place of
5
+ ** a legal notice, here is a blessing:
6
+ **
7
+ ** May you do good and not evil.
8
+ ** May you find forgiveness for yourself and forgive others.
9
+ ** May you share freely, never taking more than you give.
10
+ **
11
+ *************************************************************************
12
+ ** This header file defines the SQLite interface for use by
13
+ ** shared libraries that want to be imported as extensions into
14
+ ** an SQLite instance. Shared libraries that intend to be loaded
15
+ ** as extensions by SQLite should #include this file instead of
16
+ ** sqlite3.h.
17
+ **
18
+ ** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $
19
+ */
20
+ #ifndef _SQLITE3EXT_H_
21
+ #define _SQLITE3EXT_H_
22
+ #include "sqlite3.h"
23
+
24
+ typedef struct sqlite3_api_routines sqlite3_api_routines;
25
+
26
+ /*
27
+ ** The following structure holds pointers to all of the SQLite API
28
+ ** routines.
29
+ **
30
+ ** WARNING: In order to maintain backwards compatibility, add new
31
+ ** interfaces to the end of this structure only. If you insert new
32
+ ** interfaces in the middle of this structure, then older different
33
+ ** versions of SQLite will not be able to load each others' shared
34
+ ** libraries!
35
+ */
36
+ struct sqlite3_api_routines {
37
+ void * (*aggregate_context)(sqlite3_context*,int nBytes);
38
+ int (*aggregate_count)(sqlite3_context*);
39
+ int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
40
+ int (*bind_double)(sqlite3_stmt*,int,double);
41
+ int (*bind_int)(sqlite3_stmt*,int,int);
42
+ int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
43
+ int (*bind_null)(sqlite3_stmt*,int);
44
+ int (*bind_parameter_count)(sqlite3_stmt*);
45
+ int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
46
+ const char * (*bind_parameter_name)(sqlite3_stmt*,int);
47
+ int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
48
+ int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
49
+ int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
50
+ int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
51
+ int (*busy_timeout)(sqlite3*,int ms);
52
+ int (*changes)(sqlite3*);
53
+ int (*close)(sqlite3*);
54
+ int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*));
55
+ int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const void*));
56
+ const void * (*column_blob)(sqlite3_stmt*,int iCol);
57
+ int (*column_bytes)(sqlite3_stmt*,int iCol);
58
+ int (*column_bytes16)(sqlite3_stmt*,int iCol);
59
+ int (*column_count)(sqlite3_stmt*pStmt);
60
+ const char * (*column_database_name)(sqlite3_stmt*,int);
61
+ const void * (*column_database_name16)(sqlite3_stmt*,int);
62
+ const char * (*column_decltype)(sqlite3_stmt*,int i);
63
+ const void * (*column_decltype16)(sqlite3_stmt*,int);
64
+ double (*column_double)(sqlite3_stmt*,int iCol);
65
+ int (*column_int)(sqlite3_stmt*,int iCol);
66
+ sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
67
+ const char * (*column_name)(sqlite3_stmt*,int);
68
+ const void * (*column_name16)(sqlite3_stmt*,int);
69
+ const char * (*column_origin_name)(sqlite3_stmt*,int);
70
+ const void * (*column_origin_name16)(sqlite3_stmt*,int);
71
+ const char * (*column_table_name)(sqlite3_stmt*,int);
72
+ const void * (*column_table_name16)(sqlite3_stmt*,int);
73
+ const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
74
+ const void * (*column_text16)(sqlite3_stmt*,int iCol);
75
+ int (*column_type)(sqlite3_stmt*,int iCol);
76
+ sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
77
+ void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
78
+ int (*complete)(const char*sql);
79
+ int (*complete16)(const void*sql);
80
+ int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
81
+ int (*create_collation16)(sqlite3*,const void*,int,void*,int(*)(void*,int,const void*,int,const void*));
82
+ int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
83
+ int (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
84
+ int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
85
+ int (*data_count)(sqlite3_stmt*pStmt);
86
+ sqlite3 * (*db_handle)(sqlite3_stmt*);
87
+ int (*declare_vtab)(sqlite3*,const char*);
88
+ int (*enable_shared_cache)(int);
89
+ int (*errcode)(sqlite3*db);
90
+ const char * (*errmsg)(sqlite3*);
91
+ const void * (*errmsg16)(sqlite3*);
92
+ int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
93
+ int (*expired)(sqlite3_stmt*);
94
+ int (*finalize)(sqlite3_stmt*pStmt);
95
+ void (*free)(void*);
96
+ void (*free_table)(char**result);
97
+ int (*get_autocommit)(sqlite3*);
98
+ void * (*get_auxdata)(sqlite3_context*,int);
99
+ int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
100
+ int (*global_recover)(void);
101
+ void (*interruptx)(sqlite3*);
102
+ sqlite_int64 (*last_insert_rowid)(sqlite3*);
103
+ const char * (*libversion)(void);
104
+ int (*libversion_number)(void);
105
+ void *(*malloc)(int);
106
+ char * (*mprintf)(const char*,...);
107
+ int (*open)(const char*,sqlite3**);
108
+ int (*open16)(const void*,sqlite3**);
109
+ int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
110
+ int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
111
+ void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
112
+ void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
113
+ void *(*realloc)(void*,int);
114
+ int (*reset)(sqlite3_stmt*pStmt);
115
+ void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
116
+ void (*result_double)(sqlite3_context*,double);
117
+ void (*result_error)(sqlite3_context*,const char*,int);
118
+ void (*result_error16)(sqlite3_context*,const void*,int);
119
+ void (*result_int)(sqlite3_context*,int);
120
+ void (*result_int64)(sqlite3_context*,sqlite_int64);
121
+ void (*result_null)(sqlite3_context*);
122
+ void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
123
+ void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
124
+ void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
125
+ void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
126
+ void (*result_value)(sqlite3_context*,sqlite3_value*);
127
+ void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
128
+ int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*);
129
+ void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
130
+ char * (*snprintf)(int,char*,const char*,...);
131
+ int (*step)(sqlite3_stmt*);
132
+ int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*);
133
+ void (*thread_cleanup)(void);
134
+ int (*total_changes)(sqlite3*);
135
+ void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
136
+ int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
137
+ void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*);
138
+ void * (*user_data)(sqlite3_context*);
139
+ const void * (*value_blob)(sqlite3_value*);
140
+ int (*value_bytes)(sqlite3_value*);
141
+ int (*value_bytes16)(sqlite3_value*);
142
+ double (*value_double)(sqlite3_value*);
143
+ int (*value_int)(sqlite3_value*);
144
+ sqlite_int64 (*value_int64)(sqlite3_value*);
145
+ int (*value_numeric_type)(sqlite3_value*);
146
+ const unsigned char * (*value_text)(sqlite3_value*);
147
+ const void * (*value_text16)(sqlite3_value*);
148
+ const void * (*value_text16be)(sqlite3_value*);
149
+ const void * (*value_text16le)(sqlite3_value*);
150
+ int (*value_type)(sqlite3_value*);
151
+ char *(*vmprintf)(const char*,va_list);
152
+ /* Added ??? */
153
+ int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
154
+ /* Added by 3.3.13 */
155
+ int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
156
+ int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
157
+ int (*clear_bindings)(sqlite3_stmt*);
158
+ /* Added by 3.4.1 */
159
+ int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *));
160
+ /* Added by 3.5.0 */
161
+ int (*bind_zeroblob)(sqlite3_stmt*,int,int);
162
+ int (*blob_bytes)(sqlite3_blob*);
163
+ int (*blob_close)(sqlite3_blob*);
164
+ int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**);
165
+ int (*blob_read)(sqlite3_blob*,void*,int,int);
166
+ int (*blob_write)(sqlite3_blob*,const void*,int,int);
167
+ int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*));
168
+ int (*file_control)(sqlite3*,const char*,int,void*);
169
+ sqlite3_int64 (*memory_highwater)(int);
170
+ sqlite3_int64 (*memory_used)(void);
171
+ sqlite3_mutex *(*mutex_alloc)(int);
172
+ void (*mutex_enter)(sqlite3_mutex*);
173
+ void (*mutex_free)(sqlite3_mutex*);
174
+ void (*mutex_leave)(sqlite3_mutex*);
175
+ int (*mutex_try)(sqlite3_mutex*);
176
+ int (*open_v2)(const char*,sqlite3**,int,const char*);
177
+ int (*release_memory)(int);
178
+ void (*result_error_nomem)(sqlite3_context*);
179
+ void (*result_error_toobig)(sqlite3_context*);
180
+ int (*sleep)(int);
181
+ void (*soft_heap_limit)(int);
182
+ sqlite3_vfs *(*vfs_find)(const char*);
183
+ int (*vfs_register)(sqlite3_vfs*,int);
184
+ int (*vfs_unregister)(sqlite3_vfs*);
185
+ int (*xthreadsafe)(void);
186
+ void (*result_zeroblob)(sqlite3_context*,int);
187
+ void (*result_error_code)(sqlite3_context*,int);
188
+ int (*test_control)(int, ...);
189
+ void (*randomness)(int,void*);
190
+ sqlite3 *(*context_db_handle)(sqlite3_context*);
191
+ int (*extended_result_codes)(sqlite3*,int);
192
+ int (*limit)(sqlite3*,int,int);
193
+ sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
194
+ const char *(*sql)(sqlite3_stmt*);
195
+ int (*status)(int,int*,int*,int);
196
+ };
197
+
198
+ /*
199
+ ** The following macros redefine the API routines so that they are
200
+ ** redirected throught the global sqlite3_api structure.
201
+ **
202
+ ** This header file is also used by the loadext.c source file
203
+ ** (part of the main SQLite library - not an extension) so that
204
+ ** it can get access to the sqlite3_api_routines structure
205
+ ** definition. But the main library does not want to redefine
206
+ ** the API. So the redefinition macros are only valid if the
207
+ ** SQLITE_CORE macros is undefined.
208
+ */
209
+ #ifndef SQLITE_CORE
210
+ #define sqlite3_aggregate_context sqlite3_api->aggregate_context
211
+ #ifndef SQLITE_OMIT_DEPRECATED
212
+ #define sqlite3_aggregate_count sqlite3_api->aggregate_count
213
+ #endif
214
+ #define sqlite3_bind_blob sqlite3_api->bind_blob
215
+ #define sqlite3_bind_double sqlite3_api->bind_double
216
+ #define sqlite3_bind_int sqlite3_api->bind_int
217
+ #define sqlite3_bind_int64 sqlite3_api->bind_int64
218
+ #define sqlite3_bind_null sqlite3_api->bind_null
219
+ #define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
220
+ #define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
221
+ #define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
222
+ #define sqlite3_bind_text sqlite3_api->bind_text
223
+ #define sqlite3_bind_text16 sqlite3_api->bind_text16
224
+ #define sqlite3_bind_value sqlite3_api->bind_value
225
+ #define sqlite3_busy_handler sqlite3_api->busy_handler
226
+ #define sqlite3_busy_timeout sqlite3_api->busy_timeout
227
+ #define sqlite3_changes sqlite3_api->changes
228
+ #define sqlite3_close sqlite3_api->close
229
+ #define sqlite3_collation_needed sqlite3_api->collation_needed
230
+ #define sqlite3_collation_needed16 sqlite3_api->collation_needed16
231
+ #define sqlite3_column_blob sqlite3_api->column_blob
232
+ #define sqlite3_column_bytes sqlite3_api->column_bytes
233
+ #define sqlite3_column_bytes16 sqlite3_api->column_bytes16
234
+ #define sqlite3_column_count sqlite3_api->column_count
235
+ #define sqlite3_column_database_name sqlite3_api->column_database_name
236
+ #define sqlite3_column_database_name16 sqlite3_api->column_database_name16
237
+ #define sqlite3_column_decltype sqlite3_api->column_decltype
238
+ #define sqlite3_column_decltype16 sqlite3_api->column_decltype16
239
+ #define sqlite3_column_double sqlite3_api->column_double
240
+ #define sqlite3_column_int sqlite3_api->column_int
241
+ #define sqlite3_column_int64 sqlite3_api->column_int64
242
+ #define sqlite3_column_name sqlite3_api->column_name
243
+ #define sqlite3_column_name16 sqlite3_api->column_name16
244
+ #define sqlite3_column_origin_name sqlite3_api->column_origin_name
245
+ #define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
246
+ #define sqlite3_column_table_name sqlite3_api->column_table_name
247
+ #define sqlite3_column_table_name16 sqlite3_api->column_table_name16
248
+ #define sqlite3_column_text sqlite3_api->column_text
249
+ #define sqlite3_column_text16 sqlite3_api->column_text16
250
+ #define sqlite3_column_type sqlite3_api->column_type
251
+ #define sqlite3_column_value sqlite3_api->column_value
252
+ #define sqlite3_commit_hook sqlite3_api->commit_hook
253
+ #define sqlite3_complete sqlite3_api->complete
254
+ #define sqlite3_complete16 sqlite3_api->complete16
255
+ #define sqlite3_create_collation sqlite3_api->create_collation
256
+ #define sqlite3_create_collation16 sqlite3_api->create_collation16
257
+ #define sqlite3_create_function sqlite3_api->create_function
258
+ #define sqlite3_create_function16 sqlite3_api->create_function16
259
+ #define sqlite3_create_module sqlite3_api->create_module
260
+ #define sqlite3_create_module_v2 sqlite3_api->create_module_v2
261
+ #define sqlite3_data_count sqlite3_api->data_count
262
+ #define sqlite3_db_handle sqlite3_api->db_handle
263
+ #define sqlite3_declare_vtab sqlite3_api->declare_vtab
264
+ #define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
265
+ #define sqlite3_errcode sqlite3_api->errcode
266
+ #define sqlite3_errmsg sqlite3_api->errmsg
267
+ #define sqlite3_errmsg16 sqlite3_api->errmsg16
268
+ #define sqlite3_exec sqlite3_api->exec
269
+ #ifndef SQLITE_OMIT_DEPRECATED
270
+ #define sqlite3_expired sqlite3_api->expired
271
+ #endif
272
+ #define sqlite3_finalize sqlite3_api->finalize
273
+ #define sqlite3_free sqlite3_api->free
274
+ #define sqlite3_free_table sqlite3_api->free_table
275
+ #define sqlite3_get_autocommit sqlite3_api->get_autocommit
276
+ #define sqlite3_get_auxdata sqlite3_api->get_auxdata
277
+ #define sqlite3_get_table sqlite3_api->get_table
278
+ #ifndef SQLITE_OMIT_DEPRECATED
279
+ #define sqlite3_global_recover sqlite3_api->global_recover
280
+ #endif
281
+ #define sqlite3_interrupt sqlite3_api->interruptx
282
+ #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
283
+ #define sqlite3_libversion sqlite3_api->libversion
284
+ #define sqlite3_libversion_number sqlite3_api->libversion_number
285
+ #define sqlite3_malloc sqlite3_api->malloc
286
+ #define sqlite3_mprintf sqlite3_api->mprintf
287
+ #define sqlite3_open sqlite3_api->open
288
+ #define sqlite3_open16 sqlite3_api->open16
289
+ #define sqlite3_prepare sqlite3_api->prepare
290
+ #define sqlite3_prepare16 sqlite3_api->prepare16
291
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
292
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
293
+ #define sqlite3_profile sqlite3_api->profile
294
+ #define sqlite3_progress_handler sqlite3_api->progress_handler
295
+ #define sqlite3_realloc sqlite3_api->realloc
296
+ #define sqlite3_reset sqlite3_api->reset
297
+ #define sqlite3_result_blob sqlite3_api->result_blob
298
+ #define sqlite3_result_double sqlite3_api->result_double
299
+ #define sqlite3_result_error sqlite3_api->result_error
300
+ #define sqlite3_result_error16 sqlite3_api->result_error16
301
+ #define sqlite3_result_int sqlite3_api->result_int
302
+ #define sqlite3_result_int64 sqlite3_api->result_int64
303
+ #define sqlite3_result_null sqlite3_api->result_null
304
+ #define sqlite3_result_text sqlite3_api->result_text
305
+ #define sqlite3_result_text16 sqlite3_api->result_text16
306
+ #define sqlite3_result_text16be sqlite3_api->result_text16be
307
+ #define sqlite3_result_text16le sqlite3_api->result_text16le
308
+ #define sqlite3_result_value sqlite3_api->result_value
309
+ #define sqlite3_rollback_hook sqlite3_api->rollback_hook
310
+ #define sqlite3_set_authorizer sqlite3_api->set_authorizer
311
+ #define sqlite3_set_auxdata sqlite3_api->set_auxdata
312
+ #define sqlite3_snprintf sqlite3_api->snprintf
313
+ #define sqlite3_step sqlite3_api->step
314
+ #define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
315
+ #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
316
+ #define sqlite3_total_changes sqlite3_api->total_changes
317
+ #define sqlite3_trace sqlite3_api->trace
318
+ #ifndef SQLITE_OMIT_DEPRECATED
319
+ #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
320
+ #endif
321
+ #define sqlite3_update_hook sqlite3_api->update_hook
322
+ #define sqlite3_user_data sqlite3_api->user_data
323
+ #define sqlite3_value_blob sqlite3_api->value_blob
324
+ #define sqlite3_value_bytes sqlite3_api->value_bytes
325
+ #define sqlite3_value_bytes16 sqlite3_api->value_bytes16
326
+ #define sqlite3_value_double sqlite3_api->value_double
327
+ #define sqlite3_value_int sqlite3_api->value_int
328
+ #define sqlite3_value_int64 sqlite3_api->value_int64
329
+ #define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
330
+ #define sqlite3_value_text sqlite3_api->value_text
331
+ #define sqlite3_value_text16 sqlite3_api->value_text16
332
+ #define sqlite3_value_text16be sqlite3_api->value_text16be
333
+ #define sqlite3_value_text16le sqlite3_api->value_text16le
334
+ #define sqlite3_value_type sqlite3_api->value_type
335
+ #define sqlite3_vmprintf sqlite3_api->vmprintf
336
+ #define sqlite3_overload_function sqlite3_api->overload_function
337
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
338
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
339
+ #define sqlite3_clear_bindings sqlite3_api->clear_bindings
340
+ #define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
341
+ #define sqlite3_blob_bytes sqlite3_api->blob_bytes
342
+ #define sqlite3_blob_close sqlite3_api->blob_close
343
+ #define sqlite3_blob_open sqlite3_api->blob_open
344
+ #define sqlite3_blob_read sqlite3_api->blob_read
345
+ #define sqlite3_blob_write sqlite3_api->blob_write
346
+ #define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
347
+ #define sqlite3_file_control sqlite3_api->file_control
348
+ #define sqlite3_memory_highwater sqlite3_api->memory_highwater
349
+ #define sqlite3_memory_used sqlite3_api->memory_used
350
+ #define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
351
+ #define sqlite3_mutex_enter sqlite3_api->mutex_enter
352
+ #define sqlite3_mutex_free sqlite3_api->mutex_free
353
+ #define sqlite3_mutex_leave sqlite3_api->mutex_leave
354
+ #define sqlite3_mutex_try sqlite3_api->mutex_try
355
+ #define sqlite3_open_v2 sqlite3_api->open_v2
356
+ #define sqlite3_release_memory sqlite3_api->release_memory
357
+ #define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
358
+ #define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
359
+ #define sqlite3_sleep sqlite3_api->sleep
360
+ #define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
361
+ #define sqlite3_vfs_find sqlite3_api->vfs_find
362
+ #define sqlite3_vfs_register sqlite3_api->vfs_register
363
+ #define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
364
+ #define sqlite3_threadsafe sqlite3_api->xthreadsafe
365
+ #define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
366
+ #define sqlite3_result_error_code sqlite3_api->result_error_code
367
+ #define sqlite3_test_control sqlite3_api->test_control
368
+ #define sqlite3_randomness sqlite3_api->randomness
369
+ #define sqlite3_context_db_handle sqlite3_api->context_db_handle
370
+ #define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
371
+ #define sqlite3_limit sqlite3_api->limit
372
+ #define sqlite3_next_stmt sqlite3_api->next_stmt
373
+ #define sqlite3_sql sqlite3_api->sql
374
+ #define sqlite3_status sqlite3_api->status
375
+ #endif /* SQLITE_CORE */
376
+
377
+ #define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
378
+ #define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
379
+
380
+ #endif /* _SQLITE3EXT_H_ */
data/gemspec.rb ADDED
@@ -0,0 +1,60 @@
1
+ require 'rubygems'
2
+ require 'amalgalite/version'
3
+ require 'tasks/config'
4
+
5
+ Amalgalite::GEM_SPEC = Gem::Specification.new do |spec|
6
+ proj = Configuration.for('project')
7
+ spec.name = proj.name
8
+ spec.version = Amalgalite::VERSION
9
+
10
+ spec.author = proj.author
11
+ spec.email = proj.email
12
+ spec.homepage = proj.homepage
13
+ spec.summary = proj.summary
14
+ spec.description = proj.description
15
+ spec.platform = Gem::Platform::RUBY
16
+
17
+
18
+ pkg = Configuration.for('packaging')
19
+ spec.files = pkg.files.all
20
+ spec.executables = pkg.files.bin.collect { |b| File.basename(b) }
21
+
22
+ # add dependencies here
23
+ spec.add_dependency("arrayfields", "~> 4.7.0")
24
+
25
+ spec.add_development_dependency("rake", "~> 0.8.4")
26
+ spec.add_development_dependency("configuration", "~> 0.0.5")
27
+ spec.add_development_dependency("rspec", "~> 1.2.2")
28
+ spec.add_development_dependency("rake-compiler", "~> 0.5.0")
29
+
30
+ if ext_conf = Configuration.for_if_exist?("extension") then
31
+ spec.extensions << ext_conf.configs
32
+ spec.extensions.flatten!
33
+ end
34
+
35
+ if rdoc = Configuration.for_if_exist?('rdoc') then
36
+ spec.has_rdoc = true
37
+ spec.extra_rdoc_files = pkg.files.rdoc
38
+ spec.rdoc_options = rdoc.options + [ "--main" , rdoc.main_page ]
39
+ else
40
+ spec.has_rdoc = false
41
+ end
42
+
43
+ if test = Configuration.for_if_exist?('testing') then
44
+ spec.test_files = test.files
45
+ end
46
+
47
+ if rf = Configuration.for_if_exist?('rubyforge') then
48
+ spec.rubyforge_project = rf.project
49
+ end
50
+ end
51
+
52
+ Amalgalite::GEM_SPEC_MSWIN32 = Amalgalite::GEM_SPEC.clone
53
+ Amalgalite::GEM_SPEC_MSWIN32.platform = ::Gem::Platform.new( "i386-mswin32" )
54
+ Amalgalite::GEM_SPEC_MSWIN32.extensions = []
55
+
56
+ Amalgalite::GEM_SPEC_MINGW32= Amalgalite::GEM_SPEC.clone
57
+ Amalgalite::GEM_SPEC_MINGW32.platform = ::Gem::Platform.new( "i386-mingw32" )
58
+ Amalgalite::GEM_SPEC_MINGW32.extensions = []
59
+
60
+ Amalgalite::SPECS = [ Amalgalite::GEM_SPEC, Amalgalite::GEM_SPEC_MSWIN32, Amalgalite::GEM_SPEC_MINGW32 ]
data/lib/amalgalite.rb ADDED
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2008 Jeremy Hinegardner
3
+ # All rights reserved. See LICENSE and/or COPYING for details.
4
+ #++
5
+
6
+ # check if sqlite3 has already been required. Amalgalite conflicts with system
7
+ # level sqlite3 libraries.
8
+ unless $LOADED_FEATURES.grep( /sqlite3/ ).empty? then
9
+ raise LoadError, "amalgalite conflicts with sqlite3-ruby, please choose one or the other."
10
+ end
11
+
12
+ module Amalgalite
13
+ #
14
+ # Base class of all errors in Amalgalite
15
+ #
16
+ class Error < ::StandardError; end
17
+ end
18
+
19
+ # use a version subdirectory for extensions, initially to support windows, but
20
+ # why make a special case, it doesn't hurt anyone to have an extra subdir
21
+ # someplace
22
+ require "amalgalite/#{RUBY_VERSION.sub(/\.\d$/,'')}/amalgalite3"
23
+
24
+ require 'amalgalite/aggregate'
25
+ require 'amalgalite/blob'
26
+ require 'amalgalite/boolean'
27
+ require 'amalgalite/busy_timeout'
28
+ require 'amalgalite/column'
29
+ require 'amalgalite/database'
30
+ require 'amalgalite/function'
31
+ require 'amalgalite/index'
32
+ require 'amalgalite/paths'
33
+ require 'amalgalite/profile_tap'
34
+ require 'amalgalite/progress_handler'
35
+ require 'amalgalite/schema'
36
+ require 'amalgalite/sqlite3'
37
+ require 'amalgalite/statement'
38
+ require 'amalgalite/table'
39
+ require 'amalgalite/taps'
40
+ require 'amalgalite/trace_tap'
41
+ require 'amalgalite/type_map'
42
+ require 'amalgalite/version'
43
+ require 'amalgalite/view'