sqlite3 2.8.1-x86_64-darwin → 2.9.0-x86_64-darwin

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd9a6bad52f6776fad7bd8a7734e8fd741513e459e822ca0c3e5035f04082207
4
- data.tar.gz: 23918dcccff930a4851dd36f2c50a06d44f4b527b46195d1007d0d74ec3260a5
3
+ metadata.gz: b035b4f38d5a304b9c70c3c4c03cee849cd0ea38193192408f5dd7bf004b33ec
4
+ data.tar.gz: 2e45477c7ec983e22cb0e1f7f0efadf2a958737d809ac6cb7058f39983a1ee29
5
5
  SHA512:
6
- metadata.gz: d73a3ea6e5362f2d225bfb87ce42446caa8205f6936fc9f7552ccf77a03531177a70a912460da70eb79f1d863700dd9349a01748493d77b61f6b3affe2c1df8e
7
- data.tar.gz: f51f3f54875ea91deb8448815d6b181aa0ca43c14c60ee559f8c120625ee60e7d939b3a09375673a0c4e49f5ff5c479d84bb354c95e00ef8fcbff59fe2c764e1
6
+ metadata.gz: 601b8b6bfde26558a21c026ff4eaddbcb955f5008879b5f25fb348f634d4b004a8e726da71d54a5cec4cceaf91884472bedc6b0dda1a12b0a9e2e8dc6e442276
7
+ data.tar.gz: 666e72bd6b64495891602b1464070f0816589f9eab8760beb724c332a6811875a9569f5d4deb5dcc195b5766dafd9544e55cd7d1459097ed9c89f3b02d8855cd
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 (or
128
- number). When the placeholder is associated with a number, that number
129
- identifies the index of the bind variable to replace it with. When it
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
- mark--the placeholder is assigned a number one greater than the last
133
- index used, or 1 if it is the first.)
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.0.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
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.17)
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.17)
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.1:
28
+ For example, on a linux system running Ruby 3.4:
29
29
 
30
30
  ``` text
31
31
  $ ruby -v
32
- ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
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-1.5.0-x86_64-linux.gem
36
- Successfully installed sqlite3-1.5.0-x86_64-linux
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 0m4.274s
40
- user 0m0.734s
41
- sys 0m0.165s
39
+ real 0m1.273s
40
+ user 0m0.496s
41
+ sys 0m0.078s
42
42
  ```
43
43
 
44
44
  #### Avoiding the precompiled native gem
@@ -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.memory_used
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
@@ -1,4 +1,4 @@
1
1
  module SQLite3
2
2
  # (String) the version of the sqlite3 gem, e.g. "2.1.1"
3
- VERSION = "2.8.1"
3
+ VERSION = "2.9.0"
4
4
  end
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.8.1
4
+ version: 2.9.0
5
5
  platform: x86_64-darwin
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.bundle
54
53
  - lib/sqlite3/3.2/sqlite3_native.bundle
55
54
  - lib/sqlite3/3.3/sqlite3_native.bundle
56
55
  - lib/sqlite3/3.4/sqlite3_native.bundle
56
+ - lib/sqlite3/4.0/sqlite3_native.bundle
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.1'
86
+ version: '3.2'
87
87
  - - "<"
88
88
  - !ruby/object:Gem::Version
89
- version: 3.5.dev
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: '0'
95
95
  requirements: []
96
- rubygems_version: 3.6.9
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: []