extralite 1.9 → 1.10

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: 874f2ebc573b23e4336b69409252b2cbb8c71c1275b1ca34d1d1924999d8ed31
4
- data.tar.gz: 5b304d82a818c3e0da2dd72bca6fa590ff8be84241c6dc54fdb9f3bee49e498a
3
+ metadata.gz: e1dbf79f19c8e1a1b31da57db9e1b20eb32efed2a510dfd1a19df048ecdf6532
4
+ data.tar.gz: 633afbfd7042dedb38a5275d525bf9876a8cd194e6b6f95db183d78019c53816
5
5
  SHA512:
6
- metadata.gz: dd039c09306a04eb1e1cd42eb968c58cbf7693fd09c31587e9b7853a061c2a607af9d594859510f6cabc2ef5f166426a5a0ae4459b40168b10ea3fc4c6e3063f
7
- data.tar.gz: 2b65161b0ec69a8072e8e2f343386d8178194d1dae3bfc2ac16e414f5682d2ca1da501057f1da38cf875238e0314aa35032dcdbbf3d610affe14fb572713435a
6
+ metadata.gz: 9987a2e1b14e9213a289d04d79a0914e6d3a843c5af94e4d57d6839f193b8294b57b280141dd4784419d9f920d8b1ee32f9a21efee56a85ff524128bc4262aed
7
+ data.tar.gz: 2b53f9dd796f37e7c901f88b5bfe2b28463c0465ff5aaf0ade160b1ecf95f0beb7b0cd56496e3c76bd4f754ef7649bf8a704ff7eb94053a7b7f1b1099cf31a5b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.10 2021-12-15
2
+
3
+ - Fix mutliple parameter binding with hash
4
+
1
5
  ## 1.9 2021-12-15
2
6
 
3
7
  - Add support for reading BLOBs
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- extralite (1.9)
4
+ extralite (1.10)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -136,16 +136,16 @@ static inline void bind_hash_parameter_values(sqlite3_stmt *stmt, VALUE hash) {
136
136
  switch (TYPE(k)) {
137
137
  case T_FIXNUM:
138
138
  bind_parameter_value(stmt, NUM2INT(k), v);
139
- return;
139
+ break;
140
140
  case T_SYMBOL:
141
141
  k = rb_funcall(k, ID_TO_S, 0);
142
142
  case T_STRING:
143
143
  if(RSTRING_PTR(k)[0] != ':') k = rb_str_plus(rb_str_new2(":"), k);
144
144
  int pos = sqlite3_bind_parameter_index(stmt, StringValuePtr(k));
145
145
  bind_parameter_value(stmt, pos, v);
146
- return;
146
+ break;
147
147
  default:
148
- rb_raise(cError, "Cannot bind hash key value idx %d", i);
148
+ rb_raise(cError, "Cannot bind hash key value idx %d", i);
149
149
  }
150
150
  }
151
151
  RB_GC_GUARD(keys);
@@ -1,3 +1,3 @@
1
1
  module Extralite
2
- VERSION = '1.9'
2
+ VERSION = '1.10'
3
3
  end
@@ -139,6 +139,14 @@ end
139
139
  assert_equal [{ x: 4, y: 5, z: 6 }], r
140
140
  end
141
141
 
142
+ def test_parameter_binding_with_index_key
143
+ r = @db.query('select x, y, z from t where z = ?', 1 => 3)
144
+ assert_equal [{ x: 1, y: 2, z: 3 }], r
145
+
146
+ r = @db.query('select x, y, z from t where x = ?2', 1 => 42, 2 => 4)
147
+ assert_equal [{ x: 4, y: 5, z: 6 }], r
148
+ end
149
+
142
150
  def test_value_casting
143
151
  r = @db.query_single_value("select 'abc'")
144
152
  assert_equal 'abc', r
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: '1.9'
4
+ version: '1.10'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner