sqlite3 2.8.1-x86_64-linux-gnu → 2.9.0-x86_64-linux-gnu
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/CHANGELOG.md +16 -0
- data/FAQ.md +9 -7
- data/INSTALLATION.md +10 -10
- data/ext/sqlite3/statement.c +36 -1
- data/lib/sqlite3/3.2/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.3/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.4/sqlite3_native.so +0 -0
- data/lib/sqlite3/{3.1 → 4.0}/sqlite3_native.so +0 -0
- data/lib/sqlite3/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5fc03d84c59ef4e6ab770cedce00e047414f82a992a5bc74c4d4bfabe3312ec
|
|
4
|
+
data.tar.gz: 9a757d35779310313acdeeff5e319c4cf52cedabf434ae664a99f064c0b1a9bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1afc9ce8e4a295bdb23fcfcf72dacdca7471470a3c2a6bca05e2db4719afd2a3da39e0f35a98b6463833f0d97f823ddd5f2adddde67ff74135b6657f05947ba4
|
|
7
|
+
data.tar.gz: 5b1ef3b0d4d901e801d3642cd9cbcee2598f1031d664e97aa5647cc287fc5966bde07f3486e55ad7aadfa6a3534be3e4146e48e9340009fb21db51431ff38063
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# sqlite3-ruby Changelog
|
|
2
2
|
|
|
3
|
+
## 2.9.0 / 2025-12-27
|
|
4
|
+
|
|
5
|
+
### Ruby
|
|
6
|
+
|
|
7
|
+
- Introduce native gem packages for Ruby 4.0. @flavorjones
|
|
8
|
+
- Drop support for Ruby 3.1. @flavorjones
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Introduce `Statement#named_params` to introspect on a parameterized SQL statement. #627 #642 @captn3m0
|
|
13
|
+
|
|
14
|
+
### Improved
|
|
15
|
+
|
|
16
|
+
- Small improvements to docstrings and comments. @flavorjones @houyuanjie
|
|
17
|
+
|
|
18
|
+
|
|
3
19
|
## 2.8.1 / 2025-11-29
|
|
4
20
|
|
|
5
21
|
- Vendored sqlite is updated to [v3.51.1](https://www.sqlite.org/releaselog/3_51_1.html) (from v3.51.0). #659 @flavorjones
|
data/FAQ.md
CHANGED
|
@@ -122,15 +122,17 @@ Placeholders in an SQL statement take any of the following formats:
|
|
|
122
122
|
* `?`
|
|
123
123
|
* `?_nnn_`
|
|
124
124
|
* `:_word_`
|
|
125
|
+
* `$_word_`
|
|
126
|
+
* `@_word_`
|
|
125
127
|
|
|
126
128
|
|
|
127
|
-
Where _n_ is an integer, and _word_ is an alpha-numeric identifier
|
|
128
|
-
|
|
129
|
-
identifies the index of the bind variable to replace it with.
|
|
130
|
-
is an identifier, it identifies the name of the corresponding bind
|
|
131
|
-
variable. (In the instance of the first format--a single question
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
Where _n_ is an integer, and _word_ is an alpha-numeric identifier(or number).
|
|
130
|
+
When the placeholder is associated with a number (only in case of `?_nnn_`),
|
|
131
|
+
that number identifies the index of the bind variable to replace it with.
|
|
132
|
+
When it is an identifier, it identifies the name of the corresponding bind
|
|
133
|
+
variable. (In the instance of the first format--a single question mark--the
|
|
134
|
+
placeholder is assigned a number one greater than the last index used, or 1
|
|
135
|
+
if it is the first.)
|
|
134
136
|
|
|
135
137
|
|
|
136
138
|
For example, here is a query using these placeholder formats:
|
data/INSTALLATION.md
CHANGED
|
@@ -7,7 +7,7 @@ This document will help you install the `sqlite3` ruby gem. It also contains ins
|
|
|
7
7
|
|
|
8
8
|
### Native Gems (recommended)
|
|
9
9
|
|
|
10
|
-
In v2.
|
|
10
|
+
In v2.5.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
|
|
11
11
|
|
|
12
12
|
- `aarch64-linux-gnu` (requires: glibc >= 2.29)
|
|
13
13
|
- `aarch64-linux-musl`
|
|
@@ -15,30 +15,30 @@ In v2.0.0 and later, native (precompiled) gems are available for recent Ruby ver
|
|
|
15
15
|
- `arm-linux-musl`
|
|
16
16
|
- `arm64-darwin`
|
|
17
17
|
- `x64-mingw-ucrt`
|
|
18
|
-
- `x86-linux-gnu` (requires: glibc >= 2.
|
|
18
|
+
- `x86-linux-gnu` (requires: glibc >= 2.29)
|
|
19
19
|
- `x86-linux-musl`
|
|
20
20
|
- `x86_64-darwin`
|
|
21
|
-
- `x86_64-linux-gnu` (requires: glibc >= 2.
|
|
21
|
+
- `x86_64-linux-gnu` (requires: glibc >= 2.29)
|
|
22
22
|
- `x86_64-linux-musl`
|
|
23
23
|
|
|
24
24
|
⚠ Musl linux users should update to Bundler >= 2.5.6 to avoid https://github.com/rubygems/rubygems/issues/7432
|
|
25
25
|
|
|
26
26
|
If you are using one of these Ruby versions on one of these platforms, the native gem is the recommended way to install sqlite3-ruby.
|
|
27
27
|
|
|
28
|
-
For example, on a linux system running Ruby 3.
|
|
28
|
+
For example, on a linux system running Ruby 3.4:
|
|
29
29
|
|
|
30
30
|
``` text
|
|
31
31
|
$ ruby -v
|
|
32
|
-
ruby 3.
|
|
32
|
+
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
|
|
33
33
|
|
|
34
34
|
$ time gem install sqlite3
|
|
35
|
-
Fetching sqlite3-
|
|
36
|
-
Successfully installed sqlite3-
|
|
35
|
+
Fetching sqlite3-2.8.1-x86_64-linux-gnu.gem
|
|
36
|
+
Successfully installed sqlite3-2.8.1-x86_64-linux-gnu
|
|
37
37
|
1 gem installed
|
|
38
38
|
|
|
39
|
-
real
|
|
40
|
-
user 0m0.
|
|
41
|
-
sys 0m0.
|
|
39
|
+
real 0m1.273s
|
|
40
|
+
user 0m0.496s
|
|
41
|
+
sys 0m0.078s
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
#### Avoiding the precompiled native gem
|
data/ext/sqlite3/statement.c
CHANGED
|
@@ -460,6 +460,40 @@ bind_parameter_count(VALUE self)
|
|
|
460
460
|
return INT2NUM(sqlite3_bind_parameter_count(ctx->st));
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
+
/** call-seq: stmt.named_params
|
|
464
|
+
*
|
|
465
|
+
* Return the list of named parameters in the statement.
|
|
466
|
+
* This returns a frozen array of strings (without the leading prefix character).
|
|
467
|
+
* The values of this list can be used to bind parameters
|
|
468
|
+
* to the statement using bind_param. Positional (?NNN) and anonymous (?)
|
|
469
|
+
* parameters are excluded.
|
|
470
|
+
*
|
|
471
|
+
*/
|
|
472
|
+
static VALUE
|
|
473
|
+
named_params(VALUE self)
|
|
474
|
+
{
|
|
475
|
+
sqlite3StmtRubyPtr ctx;
|
|
476
|
+
TypedData_Get_Struct(self, sqlite3StmtRuby, &statement_type, ctx);
|
|
477
|
+
|
|
478
|
+
REQUIRE_LIVE_DB(ctx);
|
|
479
|
+
REQUIRE_OPEN_STMT(ctx);
|
|
480
|
+
|
|
481
|
+
int param_count = sqlite3_bind_parameter_count(ctx->st);
|
|
482
|
+
VALUE params = rb_ary_new2(param_count);
|
|
483
|
+
|
|
484
|
+
// The first host parameter has an index of 1, not 0.
|
|
485
|
+
for (int i = 1; i <= param_count; i++) {
|
|
486
|
+
const char *name = sqlite3_bind_parameter_name(ctx->st, i);
|
|
487
|
+
// We ignore positional and anonymous parameters, and also null values, since there can be
|
|
488
|
+
// gaps in the list.
|
|
489
|
+
if (name && *name != '?') {
|
|
490
|
+
VALUE param = interned_utf8_cstr(name + 1);
|
|
491
|
+
rb_ary_push(params, param);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return rb_obj_freeze(params);
|
|
495
|
+
}
|
|
496
|
+
|
|
463
497
|
enum stmt_stat_sym {
|
|
464
498
|
stmt_stat_sym_fullscan_steps,
|
|
465
499
|
stmt_stat_sym_sorts,
|
|
@@ -594,7 +628,7 @@ stat_for(VALUE self, VALUE key)
|
|
|
594
628
|
}
|
|
595
629
|
|
|
596
630
|
#ifdef SQLITE_STMTSTATUS_MEMUSED
|
|
597
|
-
/* call-seq: stmt.
|
|
631
|
+
/* call-seq: stmt.memused
|
|
598
632
|
*
|
|
599
633
|
* Return the approximate number of bytes of heap memory used to store the prepared statement
|
|
600
634
|
*/
|
|
@@ -689,6 +723,7 @@ init_sqlite3_statement(void)
|
|
|
689
723
|
rb_define_method(cSqlite3Statement, "column_name", column_name, 1);
|
|
690
724
|
rb_define_method(cSqlite3Statement, "column_decltype", column_decltype, 1);
|
|
691
725
|
rb_define_method(cSqlite3Statement, "bind_parameter_count", bind_parameter_count, 0);
|
|
726
|
+
rb_define_method(cSqlite3Statement, "named_params", named_params, 0);
|
|
692
727
|
rb_define_method(cSqlite3Statement, "sql", get_sql, 0);
|
|
693
728
|
rb_define_method(cSqlite3Statement, "expanded_sql", get_expanded_sql, 0);
|
|
694
729
|
#ifdef HAVE_SQLITE3_COLUMN_DATABASE_NAME
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/sqlite3/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sqlite3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: x86_64-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
@@ -50,10 +50,10 @@ files:
|
|
|
50
50
|
- ext/sqlite3/statement.h
|
|
51
51
|
- ext/sqlite3/timespec.h
|
|
52
52
|
- lib/sqlite3.rb
|
|
53
|
-
- lib/sqlite3/3.1/sqlite3_native.so
|
|
54
53
|
- lib/sqlite3/3.2/sqlite3_native.so
|
|
55
54
|
- lib/sqlite3/3.3/sqlite3_native.so
|
|
56
55
|
- lib/sqlite3/3.4/sqlite3_native.so
|
|
56
|
+
- lib/sqlite3/4.0/sqlite3_native.so
|
|
57
57
|
- lib/sqlite3/constants.rb
|
|
58
58
|
- lib/sqlite3/database.rb
|
|
59
59
|
- lib/sqlite3/errors.rb
|
|
@@ -83,17 +83,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
83
83
|
requirements:
|
|
84
84
|
- - ">="
|
|
85
85
|
- !ruby/object:Gem::Version
|
|
86
|
-
version: '3.
|
|
86
|
+
version: '3.2'
|
|
87
87
|
- - "<"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
89
|
+
version: 4.1.dev
|
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
|
92
92
|
- - ">="
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: 3.3.22
|
|
95
95
|
requirements: []
|
|
96
|
-
rubygems_version:
|
|
96
|
+
rubygems_version: 4.0.3
|
|
97
97
|
specification_version: 4
|
|
98
98
|
summary: Ruby library to interface with the SQLite3 database engine (http://www.sqlite.org).
|
|
99
99
|
test_files: []
|