extralite 1.10 → 1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +22 -5
- data/ext/extralite/extralite.c +7 -7
- data/lib/extralite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88bd81eca07e148be1f8d5b07d24c0aab49b32a9dc9aeb4a9ea5a74cf769491
|
4
|
+
data.tar.gz: 9f5d55a8cd4a58e2026ca3e850d48c28d86878e191e91fb92e59c76335a64484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cca614a4e3ffde8ff56ef3e8394f85f4a57d37f8615f2f144a9a39f84d50e51dd015348da7f93340326b40ff4b16202ec21bc03f23edacf678c03f57d0955974
|
7
|
+
data.tar.gz: 2e9f9c9091ac99fa96c3562fdb1e49642b2961ee682c30d98f8babd95b8366d9c96019df7185c5ef493b330f6c32066be6868398dcdb123c4607e9ab4875462b
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<h1 align="center">
|
2
|
+
Extralite
|
3
|
+
</h1>
|
4
|
+
|
5
|
+
<h4 align="center">A fast Ruby gem for working with SQLite3 databases</h4>
|
6
|
+
|
7
|
+
<p align="center">
|
8
|
+
<a href="http://rubygems.org/gems/extralite">
|
9
|
+
<img src="https://badge.fury.io/rb/extralite.svg" alt="Ruby gem">
|
10
|
+
</a>
|
11
|
+
<a href="https://github.com/digital-fabric/extralite/actions?query=workflow%3ATests">
|
12
|
+
<img src="https://github.com/digital-fabric/extralite/workflows/Tests/badge.svg" alt="Tests">
|
13
|
+
</a>
|
14
|
+
<a href="https://github.com/digital-fabric/extralite/blob/master/LICENSE">
|
15
|
+
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License">
|
16
|
+
</a>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p align="center">
|
20
|
+
<a href="https://www.rubydoc.info/gems/extralite">DOCS</a> |
|
21
|
+
<a href="https://noteflakes.com/articles/2021-12-15-extralite">BLOG POST</a>
|
22
|
+
</p>
|
6
23
|
|
7
24
|
## What is Extralite?
|
8
25
|
|
data/ext/extralite/extralite.c
CHANGED
@@ -105,7 +105,7 @@ VALUE Database_closed_p(VALUE self) {
|
|
105
105
|
return db->sqlite3_db ? Qfalse : Qtrue;
|
106
106
|
}
|
107
107
|
|
108
|
-
inline VALUE get_column_value(sqlite3_stmt *stmt, int col, int type) {
|
108
|
+
static inline VALUE get_column_value(sqlite3_stmt *stmt, int col, int type) {
|
109
109
|
switch (type) {
|
110
110
|
case SQLITE_NULL:
|
111
111
|
return Qnil;
|
@@ -128,8 +128,8 @@ static void bind_parameter_value(sqlite3_stmt *stmt, int pos, VALUE value);
|
|
128
128
|
|
129
129
|
static inline void bind_hash_parameter_values(sqlite3_stmt *stmt, VALUE hash) {
|
130
130
|
VALUE keys = rb_funcall(hash, ID_KEYS, 0);
|
131
|
-
|
132
|
-
for (
|
131
|
+
long len = RARRAY_LEN(keys);
|
132
|
+
for (long i = 0; i < len; i++) {
|
133
133
|
VALUE k = RARRAY_AREF(keys, i);
|
134
134
|
VALUE v = rb_hash_aref(hash, k);
|
135
135
|
|
@@ -145,7 +145,7 @@ static inline void bind_hash_parameter_values(sqlite3_stmt *stmt, VALUE hash) {
|
|
145
145
|
bind_parameter_value(stmt, pos, v);
|
146
146
|
break;
|
147
147
|
default:
|
148
|
-
rb_raise(cError, "Cannot bind hash key value idx %
|
148
|
+
rb_raise(cError, "Cannot bind hash key value idx %ld", i);
|
149
149
|
}
|
150
150
|
}
|
151
151
|
RB_GC_GUARD(keys);
|
@@ -218,7 +218,7 @@ struct multi_stmt_ctx {
|
|
218
218
|
sqlite3 *db;
|
219
219
|
sqlite3_stmt **stmt;
|
220
220
|
const char *str;
|
221
|
-
|
221
|
+
long len;
|
222
222
|
int rc;
|
223
223
|
};
|
224
224
|
|
@@ -256,7 +256,7 @@ statements. It will release the GVL while the statements are being prepared and
|
|
256
256
|
executed. All statements excluding the last one are executed. The last statement
|
257
257
|
is not executed, but instead handed back to the caller for looping over results.
|
258
258
|
*/
|
259
|
-
inline void prepare_multi_stmt(sqlite3 *db, sqlite3_stmt **stmt, VALUE sql) {
|
259
|
+
static inline void prepare_multi_stmt(sqlite3 *db, sqlite3_stmt **stmt, VALUE sql) {
|
260
260
|
struct multi_stmt_ctx ctx = {db, stmt, RSTRING_PTR(sql), RSTRING_LEN(sql), 0};
|
261
261
|
rb_thread_call_without_gvl(prepare_multi_stmt_without_gvl, (void *)&ctx, RUBY_UBF_IO, 0);
|
262
262
|
RB_GC_GUARD(sql);
|
@@ -284,7 +284,7 @@ void *stmt_iterate_without_gvl(void *ptr) {
|
|
284
284
|
return NULL;
|
285
285
|
}
|
286
286
|
|
287
|
-
inline int stmt_iterate(sqlite3_stmt *stmt, sqlite3 *db) {
|
287
|
+
static inline int stmt_iterate(sqlite3_stmt *stmt, sqlite3 *db) {
|
288
288
|
struct step_ctx ctx = {stmt, 0};
|
289
289
|
rb_thread_call_without_gvl(stmt_iterate_without_gvl, (void *)&ctx, RUBY_UBF_IO, 0);
|
290
290
|
switch (ctx.rc) {
|
data/lib/extralite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extralite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|