extralite 3.0.0 → 3.0.1

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: eb66a5b2636ccad51ab5a86ff0b7802d25574a564a5c4395c838a2d26f2599b9
4
- data.tar.gz: d00921f287ba1c602c8669ff85740108a7bafb4f8111722f14055612db7afc3f
3
+ metadata.gz: 22e7b14b0233f008d2b7e0c252d14eee96c736f028266eac5be6193356ce9969
4
+ data.tar.gz: a2e4b6c13ecb6bf1c660b621c3da919ff9ab9d460cefe6bf1d4a2dc06e16b285
5
5
  SHA512:
6
- metadata.gz: be12c6a8629f83db24107fc6a6d06f1b94beff46622b9d6c0c47ed55575069cee2529389ba709a7f8dec4f31f11cb3738e3df25f17667264031014fc5e3dc7c8
7
- data.tar.gz: 43be64a94f7e29cbafb25a2b32271e1b260d2a7f5b6f69eb214c0e069faaca1973e0bb92fb6d62f1bcba05e55136369c6841d28dc22c06b3290188da1a84bba2
6
+ metadata.gz: 79b7e334dc09a45c6819027e8d6ee3a2e2e16faa82f4811989562caba93a688a629c78d9c3a53564d89a47ca9aa7ee9f2447663761d8931dd0cf2c4d69a8ed15
7
+ data.tar.gz: 9312ce8e55e1bfb121f36c93820b701217fc5abb90b5d3c2995a871c0ced0f876d9abd26b6a60cdcc57bb920a982eeb3ce572dd1f6c674a56f8227abde7fd19a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 3.0.1 2026-07-21
2
+
3
+ - Fix passing nil transform to `DB#prepare`
4
+ - Remove support for Ruby 3.2, 3.3
5
+
1
6
  ## 3.0.0 2026-07-02
2
7
 
3
8
  - Update benchmark results in README
data/TODO.md CHANGED
@@ -1,2 +1,54 @@
1
- - [ ] Version 3.0
2
- - [ ] Run benchmarks again against latest version of sqlite3 gem
1
+ ## Transforms
2
+
3
+ - Add ability to exclude a column:
4
+
5
+ ```ruby
6
+ Extralite::Transform.new do
7
+ {
8
+ id: integer.identity,
9
+ title: text,
10
+ content: text,
11
+ tags: [{
12
+ id: integer.identity.skip,
13
+ name: text
14
+ }]
15
+ }
16
+ end
17
+ #=>
18
+ [
19
+ {
20
+ id: 1,
21
+ title: 'foo',
22
+ content: 'bar',
23
+ tags: [
24
+ { name: 'baz' },
25
+ { name: 'bug' }
26
+ ]
27
+ }
28
+ ]
29
+ ```
30
+
31
+ - Can we get rid of the hash container?
32
+
33
+ ```ruby
34
+ Extralite::Transform.new do
35
+ {
36
+ id: integer.identity,
37
+ title: text,
38
+ content: text,
39
+ _tag_id: skip,
40
+ tags: [
41
+ name: text
42
+ ]
43
+ }
44
+ end
45
+ #=>
46
+ [
47
+ {
48
+ id: 1,
49
+ title: 'foo',
50
+ content: 'bar',
51
+ tags: [ 'baz', 'bug' ]
52
+ }
53
+ ]
54
+ ```
@@ -742,7 +742,7 @@ static inline VALUE Database_prepare(int argc, VALUE *argv, VALUE self, VALUE mo
742
742
  rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
743
743
 
744
744
  VALUE transform = Qnil;
745
- if (argc > 1 && rb_obj_is_instance_of(argv[0], cTransform)) {
745
+ if (argc > 1 && (NIL_P(argv[0]) || rb_obj_is_instance_of(argv[0], cTransform))) {
746
746
  transform = argv[0];
747
747
  argv++;
748
748
  argc--;
@@ -1,4 +1,4 @@
1
1
  module Extralite
2
2
  # Extralite version
3
- VERSION = '3.0.0'
3
+ VERSION = '3.0.1'
4
4
  end
@@ -669,6 +669,21 @@ class TransformPreparedQueryTest < Minitest::Test
669
669
  assert_equal result[0][:tags][1].object_id, result[1][:tags][0].object_id
670
670
  end
671
671
 
672
+ def test_transform_prepared_query_nil_transform
673
+ q = @db.prepare(nil, @sql)
674
+
675
+ result = q.to_a
676
+ assert_kind_of Array, result
677
+ assert_equal 4, result.size
678
+
679
+ assert_equal [
680
+ {id: 1, title: "T1", content: "C1", name: "tag1"},
681
+ {id: 2, title: "T1", content: "C1", name: "tag2"},
682
+ {id: 2, title: "T2", content: "C2", name: "tag2"},
683
+ {id: 3, title: "T2", content: "C2", name: "tag3"}
684
+ ], result
685
+ end
686
+
672
687
  def test_transform_prepared_query_each
673
688
  t = Extralite::Transform.new(@spec)
674
689
  q = @db.prepare(t, @sql)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extralite
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner