libsql 0.1.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +60 -0
  3. data/HISTORY.md +6 -0
  4. data/LICENSE +31 -0
  5. data/Manifest.txt +96 -0
  6. data/README.md +59 -0
  7. data/Rakefile +28 -0
  8. data/TODO.md +57 -0
  9. data/examples/a.rb +9 -0
  10. data/examples/blob.rb +106 -0
  11. data/examples/define_aggregate.rb +75 -0
  12. data/examples/define_function.rb +104 -0
  13. data/examples/fts5.rb +152 -0
  14. data/examples/gem-db.rb +94 -0
  15. data/examples/schema-info.rb +34 -0
  16. data/ext/libsql/c/extconf.rb +86 -0
  17. data/ext/libsql/c/gen_constants.rb +353 -0
  18. data/ext/libsql/c/libsql_blob.c +240 -0
  19. data/ext/libsql/c/libsql_constants.c +1518 -0
  20. data/ext/libsql/c/libsql_database.c +1188 -0
  21. data/ext/libsql/c/libsql_ext.c +383 -0
  22. data/ext/libsql/c/libsql_ext.h +149 -0
  23. data/ext/libsql/c/libsql_statement.c +649 -0
  24. data/ext/libsql/c/notes.txt +134 -0
  25. data/ext/libsql/c/sqlite3.c +247030 -0
  26. data/ext/libsql/c/sqlite3.h +13436 -0
  27. data/lib/libsql/3.1/libsql_ext.so +0 -0
  28. data/lib/libsql/3.2/libsql_ext.so +0 -0
  29. data/lib/libsql/aggregate.rb +73 -0
  30. data/lib/libsql/blob.rb +186 -0
  31. data/lib/libsql/boolean.rb +42 -0
  32. data/lib/libsql/busy_timeout.rb +47 -0
  33. data/lib/libsql/column.rb +99 -0
  34. data/lib/libsql/csv_table_importer.rb +75 -0
  35. data/lib/libsql/database.rb +933 -0
  36. data/lib/libsql/function.rb +61 -0
  37. data/lib/libsql/index.rb +43 -0
  38. data/lib/libsql/memory_database.rb +15 -0
  39. data/lib/libsql/paths.rb +80 -0
  40. data/lib/libsql/profile_tap.rb +131 -0
  41. data/lib/libsql/progress_handler.rb +21 -0
  42. data/lib/libsql/schema.rb +225 -0
  43. data/lib/libsql/sqlite3/constants.rb +95 -0
  44. data/lib/libsql/sqlite3/database/function.rb +48 -0
  45. data/lib/libsql/sqlite3/database/status.rb +68 -0
  46. data/lib/libsql/sqlite3/libsql_version.rb +32 -0
  47. data/lib/libsql/sqlite3/status.rb +60 -0
  48. data/lib/libsql/sqlite3/version.rb +55 -0
  49. data/lib/libsql/sqlite3.rb +7 -0
  50. data/lib/libsql/statement.rb +421 -0
  51. data/lib/libsql/table.rb +91 -0
  52. data/lib/libsql/taps/console.rb +27 -0
  53. data/lib/libsql/taps/io.rb +74 -0
  54. data/lib/libsql/taps.rb +2 -0
  55. data/lib/libsql/trace_tap.rb +35 -0
  56. data/lib/libsql/type_map.rb +63 -0
  57. data/lib/libsql/type_maps/default_map.rb +166 -0
  58. data/lib/libsql/type_maps/storage_map.rb +38 -0
  59. data/lib/libsql/type_maps/text_map.rb +21 -0
  60. data/lib/libsql/version.rb +8 -0
  61. data/lib/libsql/view.rb +26 -0
  62. data/lib/libsql-ruby.rb +1 -0
  63. data/lib/libsql.rb +51 -0
  64. data/spec/aggregate_spec.rb +158 -0
  65. data/spec/blob_spec.rb +78 -0
  66. data/spec/boolean_spec.rb +24 -0
  67. data/spec/busy_handler.rb +157 -0
  68. data/spec/data/iso-3166-country.txt +242 -0
  69. data/spec/data/iso-3166-schema.sql +22 -0
  70. data/spec/data/iso-3166-subcountry.txt +3995 -0
  71. data/spec/data/make-iso-db.sh +12 -0
  72. data/spec/database_spec.rb +505 -0
  73. data/spec/default_map_spec.rb +92 -0
  74. data/spec/function_spec.rb +78 -0
  75. data/spec/integeration_spec.rb +97 -0
  76. data/spec/iso_3166_database.rb +58 -0
  77. data/spec/json_spec.rb +24 -0
  78. data/spec/libsql_spec.rb +4 -0
  79. data/spec/paths_spec.rb +28 -0
  80. data/spec/progress_handler_spec.rb +91 -0
  81. data/spec/rtree_spec.rb +66 -0
  82. data/spec/schema_spec.rb +131 -0
  83. data/spec/spec_helper.rb +48 -0
  84. data/spec/sqlite3/constants_spec.rb +108 -0
  85. data/spec/sqlite3/database_status_spec.rb +36 -0
  86. data/spec/sqlite3/libsql_version_spec.rb +16 -0
  87. data/spec/sqlite3/status_spec.rb +22 -0
  88. data/spec/sqlite3/version_spec.rb +28 -0
  89. data/spec/sqlite3_spec.rb +53 -0
  90. data/spec/statement_spec.rb +168 -0
  91. data/spec/storage_map_spec.rb +38 -0
  92. data/spec/tap_spec.rb +57 -0
  93. data/spec/text_map_spec.rb +20 -0
  94. data/spec/type_map_spec.rb +14 -0
  95. data/spec/version_spec.rb +8 -0
  96. data/tasks/custom.rake +134 -0
  97. data/tasks/default.rake +257 -0
  98. data/tasks/extension.rake +29 -0
  99. data/tasks/this.rb +208 -0
  100. metadata +329 -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