libsql 0.1.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CONTRIBUTING.md +60 -0
- data/HISTORY.md +6 -0
- data/LICENSE +31 -0
- data/Manifest.txt +96 -0
- data/README.md +59 -0
- data/Rakefile +28 -0
- data/TODO.md +57 -0
- data/examples/a.rb +9 -0
- data/examples/blob.rb +106 -0
- data/examples/define_aggregate.rb +75 -0
- data/examples/define_function.rb +104 -0
- data/examples/fts5.rb +152 -0
- data/examples/gem-db.rb +94 -0
- data/examples/schema-info.rb +34 -0
- data/ext/libsql/c/extconf.rb +86 -0
- data/ext/libsql/c/gen_constants.rb +353 -0
- data/ext/libsql/c/libsql_blob.c +240 -0
- data/ext/libsql/c/libsql_constants.c +1518 -0
- data/ext/libsql/c/libsql_database.c +1188 -0
- data/ext/libsql/c/libsql_ext.c +383 -0
- data/ext/libsql/c/libsql_ext.h +149 -0
- data/ext/libsql/c/libsql_statement.c +649 -0
- data/ext/libsql/c/notes.txt +134 -0
- data/ext/libsql/c/sqlite3.c +247030 -0
- data/ext/libsql/c/sqlite3.h +13436 -0
- data/lib/libsql/aggregate.rb +73 -0
- data/lib/libsql/blob.rb +186 -0
- data/lib/libsql/boolean.rb +42 -0
- data/lib/libsql/busy_timeout.rb +47 -0
- data/lib/libsql/column.rb +99 -0
- data/lib/libsql/csv_table_importer.rb +75 -0
- data/lib/libsql/database.rb +933 -0
- data/lib/libsql/function.rb +61 -0
- data/lib/libsql/index.rb +43 -0
- data/lib/libsql/libsql_ext.so +0 -0
- data/lib/libsql/memory_database.rb +15 -0
- data/lib/libsql/paths.rb +80 -0
- data/lib/libsql/profile_tap.rb +131 -0
- data/lib/libsql/progress_handler.rb +21 -0
- data/lib/libsql/schema.rb +225 -0
- data/lib/libsql/sqlite3/constants.rb +95 -0
- data/lib/libsql/sqlite3/database/function.rb +48 -0
- data/lib/libsql/sqlite3/database/status.rb +68 -0
- data/lib/libsql/sqlite3/libsql_version.rb +32 -0
- data/lib/libsql/sqlite3/status.rb +60 -0
- data/lib/libsql/sqlite3/version.rb +55 -0
- data/lib/libsql/sqlite3.rb +7 -0
- data/lib/libsql/statement.rb +421 -0
- data/lib/libsql/table.rb +91 -0
- data/lib/libsql/taps/console.rb +27 -0
- data/lib/libsql/taps/io.rb +74 -0
- data/lib/libsql/taps.rb +2 -0
- data/lib/libsql/trace_tap.rb +35 -0
- data/lib/libsql/type_map.rb +63 -0
- data/lib/libsql/type_maps/default_map.rb +166 -0
- data/lib/libsql/type_maps/storage_map.rb +38 -0
- data/lib/libsql/type_maps/text_map.rb +21 -0
- data/lib/libsql/version.rb +8 -0
- data/lib/libsql/view.rb +26 -0
- data/lib/libsql-ruby.rb +1 -0
- data/lib/libsql.rb +51 -0
- data/spec/aggregate_spec.rb +158 -0
- data/spec/blob_spec.rb +78 -0
- data/spec/boolean_spec.rb +24 -0
- data/spec/busy_handler.rb +157 -0
- data/spec/data/iso-3166-country.txt +242 -0
- data/spec/data/iso-3166-schema.sql +22 -0
- data/spec/data/iso-3166-subcountry.txt +3995 -0
- data/spec/data/make-iso-db.sh +12 -0
- data/spec/database_spec.rb +505 -0
- data/spec/default_map_spec.rb +92 -0
- data/spec/function_spec.rb +78 -0
- data/spec/integeration_spec.rb +97 -0
- data/spec/iso_3166_database.rb +58 -0
- data/spec/json_spec.rb +24 -0
- data/spec/libsql_spec.rb +4 -0
- data/spec/paths_spec.rb +28 -0
- data/spec/progress_handler_spec.rb +91 -0
- data/spec/rtree_spec.rb +66 -0
- data/spec/schema_spec.rb +131 -0
- data/spec/spec_helper.rb +48 -0
- data/spec/sqlite3/constants_spec.rb +108 -0
- data/spec/sqlite3/database_status_spec.rb +36 -0
- data/spec/sqlite3/libsql_version_spec.rb +16 -0
- data/spec/sqlite3/status_spec.rb +22 -0
- data/spec/sqlite3/version_spec.rb +28 -0
- data/spec/sqlite3_spec.rb +53 -0
- data/spec/statement_spec.rb +168 -0
- data/spec/storage_map_spec.rb +38 -0
- data/spec/tap_spec.rb +57 -0
- data/spec/text_map_spec.rb +20 -0
- data/spec/type_map_spec.rb +14 -0
- data/spec/version_spec.rb +8 -0
- data/tasks/custom.rake +134 -0
- data/tasks/default.rake +257 -0
- data/tasks/extension.rake +29 -0
- data/tasks/this.rb +208 -0
- metadata +328 -0
@@ -0,0 +1,134 @@
|
|
1
|
+
Top level "methods"
|
2
|
+
===================
|
3
|
+
|
4
|
+
*done* const char* sqlite3_libversion(void)
|
5
|
+
*done* int sqlite3_libversion_number(void)
|
6
|
+
*done* int sqlite3_threadsave(void)
|
7
|
+
*done* int sqlite3_complete(const char*sql);
|
8
|
+
*done* int sqlite3_complete16(const void *sql);
|
9
|
+
|
10
|
+
*done* sqlite3_int64 sqlite3_memory_used(void);
|
11
|
+
*done* sqlite3_int64 sqtlie3_memory_highwater(int resetFlag);
|
12
|
+
*done* void sqlite3_randomness(int N, void *p)
|
13
|
+
|
14
|
+
*future* int sqlite3_enabled_shared_cache(int); # TODO maybe
|
15
|
+
*future* int sqlite3_release_memory(int); // maybe, hook into gc calls ?
|
16
|
+
*future* void sqlite3_soft_heap_limit(int);
|
17
|
+
*future* char* sqlite3_temp_directory;
|
18
|
+
|
19
|
+
UTF-8 vs. UTF-16
|
20
|
+
----------------
|
21
|
+
|
22
|
+
in cases where there is a xxx16() method in the C api, the ruby methods add a
|
23
|
+
flag to the method.
|
24
|
+
|
25
|
+
Core 'Objects'
|
26
|
+
==============
|
27
|
+
|
28
|
+
sqlite3 (typdef struct sqlite3) -> main database handle
|
29
|
+
-------
|
30
|
+
*done* int sqlite3_open_v2(*filename, sqlite3**, flags, NULL)
|
31
|
+
*done* int sqlite3_open16
|
32
|
+
*done* int sqlite3_extended_result_codes(sqlite3, int onoff) # default to turning this on
|
33
|
+
*skipped* called during rb_raise
|
34
|
+
*skipped* const char *sqlite3_errmsg(sqlite3*);
|
35
|
+
*skipped* const void *sqlite3_errmsg16(sqlite3*);
|
36
|
+
*done* int sqlite3_close(sqlite3 *)
|
37
|
+
*skipped* int sqlite3_exec -> don't use, wrap in ruby exec
|
38
|
+
*done* sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*)
|
39
|
+
*done* int sqlite3_get_autocommit(sqlite3*)
|
40
|
+
*done* int sqlite3_changes(sqlite3*)
|
41
|
+
*done* int sqlite3_total_changes(sqlite3*)
|
42
|
+
*skipped* int sqlite3_errcode(sqlite3 *db)
|
43
|
+
*done* int sqlite3_prepare_v2(sqlite3* db, sql, nbyte, sqlite3_stmt**, const char **tail)
|
44
|
+
|
45
|
+
int sqlite3_prepare16_v2(sqlite3* db, sql, nbyte, sqlite3_stmt**, const char **tail)
|
46
|
+
|
47
|
+
// not yet, but implement if/when a purchase of sqlite3 encryption works
|
48
|
+
TODO: int sqlite3_key(sqlite3* db, const void *pKey, int nKey);
|
49
|
+
TODO: int sqlite3_rekey(sqlite3* db, const void *pKey, int nKey);
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
TODO: int sqlite3_busy_timeout(sqlite3*)
|
54
|
+
*done* void sqlite3_progress_hander(sqlite3*, int, int(*)(void*), void*)
|
55
|
+
|
56
|
+
*done* tracing should be an IO object, if it is true then send it to STDERR
|
57
|
+
*done* tracing should also yield a block like a transaction so that during the block the db has tracing turned on.
|
58
|
+
*done* sqlite3_trace
|
59
|
+
|
60
|
+
TODO: create Table and Column classes
|
61
|
+
TODO: int sqlite3_table_column_metadata();
|
62
|
+
|
63
|
+
for later implementation
|
64
|
+
________________________
|
65
|
+
sqlite3_enable_load_extensions
|
66
|
+
sqlite3_load_extension
|
67
|
+
sqlite3_interrupt
|
68
|
+
sqlite3_busy_handler(sqlite3*, function pointer, void *)
|
69
|
+
|
70
|
+
*skip - experimental* sqlite3_profile
|
71
|
+
*Skip - experimental* sqlite3_limit(sqlite3*, int id, int newVal) -- maybe implement
|
72
|
+
*skip - experimental* sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
|
73
|
+
*skip - experimental* sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
|
74
|
+
*skip - experimental* sqlite3_update_hook(sqlite3*, function ponter, void*);
|
75
|
+
|
76
|
+
|
77
|
+
sqlite3_stmt (typedef struct sqlite3_stmt) -> handle for statements
|
78
|
+
------------
|
79
|
+
*done* const char *sqlite3_sql(sqlite3_stmt *pStmt)
|
80
|
+
*done* int sqlite3_bind_parameter_count(sqlite3_stmt*);
|
81
|
+
|
82
|
+
*done* sqlite3_bind_double(sqlite3_stmt*, int, double);
|
83
|
+
*done* sqlite3_bind_int(sqlite3_stmt*, int, int);
|
84
|
+
*done* sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
|
85
|
+
*done* sqlite3_bind_null(sqlite3_stmt*, int);
|
86
|
+
*done* sqlite3_bind_text(sqlite3_stmt*, int, constc char*, int n, void(*)(void*));
|
87
|
+
* skipping *sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
|
88
|
+
*done* const char* sqlite3_bind_parameter_name(sqlite3_stmt*, int )
|
89
|
+
*done* sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
|
90
|
+
*done* sqlite3_clear_bindings(sqlite3_stmt*);
|
91
|
+
*done* sqlite3_column_count(sqlite3_stmt *pStmt);
|
92
|
+
*done* sqlite3_column_name(sqlite3_stmt*, int N);
|
93
|
+
*skip - used internally* sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
94
|
+
*done* sqlite3_column_database_name(sqlite3_stmt*, int);
|
95
|
+
*done* sqlite3_column_table_name(sqlite3_stmt*, int);
|
96
|
+
*done* sqlite3_column_origin_name(sqlite3_stmt*, int);
|
97
|
+
*done* sqlite3_step(sqlite3_stmt*);
|
98
|
+
*done - as 'close' *int sqlite3_finalize(sqlite3_stmt *pStmt);
|
99
|
+
*done* int sqlite3_reset(sqlite3_stmt *pStmt);
|
100
|
+
*done - same as sqlite3_column_count* sqlite3_data_count(sqlite3_stmt *pStmt);
|
101
|
+
*do not use* sqlite3_value* sqlite3_column_value(sqlite3_stmt*, int iCol);
|
102
|
+
|
103
|
+
sqlite3_bind_text16(sqlite3_stmt*, int, constc char*, int, void(*)(void*));
|
104
|
+
* done *sqlite3_column_database_name16(sqlite3_stmt*, int);
|
105
|
+
* done *sqlite3_column_table_name16(sqlite3_stmt*, int);
|
106
|
+
* done *sqlite3_column_origin_name16(sqlite3_stmt*, int);
|
107
|
+
sqlite3_column_name16(sqlite3_stmt*, int N);
|
108
|
+
|
109
|
+
*done* sqlite3_column_decltype(sqlite3_stmt*, int);
|
110
|
+
sqlite3_column_decltype16(sqlite3_stmt*, int);
|
111
|
+
|
112
|
+
// use this to find the type and then call the appropriate method afterwards.
|
113
|
+
*done* sqlite3_column_type(sqlite3_stmt*, int iCol);
|
114
|
+
|
115
|
+
# binding by name or index, if passed in an array to the bind() method then
|
116
|
+
# bind by index, if passed in a hash, bind by name, using hte keys of the hash
|
117
|
+
*done* sqlite3_bind_blob(sqlite3_stmt*, int, const void *, int n, void(*)(void*));
|
118
|
+
*done* sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
|
119
|
+
|
120
|
+
|
121
|
+
sqlite3_blob
|
122
|
+
------------
|
123
|
+
// BLOB
|
124
|
+
*done* sqlite3_blob_open(sqlite3*, *db, *table, *column, rowid, flags, **blob);
|
125
|
+
*done* sqlite3_blob_close(sqlite3_blob*)
|
126
|
+
*done* sqlite3_blob_bytes(sqlite3_blob*)
|
127
|
+
*done* sqlite3_blob_read(sqlite3_blob*, *to_buffer, bytes_to_read, starting_at_offset);
|
128
|
+
*done* sqlite3_blob_write(sqlite3_blob*, *from_buffer, bytes_to_write, starting_at_offset);
|
129
|
+
|
130
|
+
Result Codes
|
131
|
+
============
|
132
|
+
|
133
|
+
*done* Convert to Individual Exceptions and allow the top level module generate them
|
134
|
+
based upon integer value
|