extralite-bundle 2.8 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6757a6d12ebfc72fade7fc2f75aada49e7dc670779552cef55f830b0a729b7ef
4
- data.tar.gz: '058484f92cc779df7603b13ce4759e32a41761734ab9b64d21f21e48b3914641'
3
+ metadata.gz: d3cd8157614888cebb1d10a4007280fbb056d172bf06447de867cf30071914bf
4
+ data.tar.gz: 8f97df0223c5e055c675b386d1e098f61ad4189cfe8f9f03010785f59e544eb6
5
5
  SHA512:
6
- metadata.gz: 8fd0e04aa351b14543103dc983392de02f6310aee0aed4e913b304b1feded5cc80074a0ff4ca33214a160b412d1435e08cbdb298f15bb55ef97eadb6dae45b0b
7
- data.tar.gz: '081327e8a2363422fb9ce898ec46b6d15ad8297be7d84d819c494bfa39c761f59a3f0d6774805217da83808697206637d76cb1fd4ee4acb65c716ac44f445088'
6
+ metadata.gz: aded223d20a4075d0d7b3f503bed83f86bec6d7c1ed16d4fdf20e9d2df0e8b636c88ce6a8bbe522a56302a9a051e5c774e15b78be5a018716aa502cf2c44a6ab
7
+ data.tar.gz: f38bdb92fd2b3a4f33af008a0b704ee1974a41660a90b46ae149f17296bdeeb46db4a9b9913af3bd2344c0bf278106ca10dc00f629a40a6c0e2ccd8e78c6df60
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.8.1 2024-04-15
2
+
3
+ - Update bundled sqlite to version 3.45.3.
4
+ - Fix `Database#execute` for SQL ending with a comment.
5
+ [#72](https://github.com/digital-fabric/extralite/pull/72)
6
+
1
7
  # 2.8 2024-03-10
2
8
 
3
9
  - Improve documentation.
data/README.md CHANGED
@@ -32,7 +32,7 @@ databases.
32
32
  Extralite comes in two flavors: the `extralite` gem which uses the
33
33
  system-installed sqlite3 library, and the `extralite-bundle` gem which bundles
34
34
  the latest version of SQLite
35
- ([3.45.0](https://sqlite.org/releaselog/3_45_0.html)), offering access to the
35
+ ([3.45.3](https://sqlite.org/releaselog/3_45_3.html)), offering access to the
36
36
  latest features and enhancements.
37
37
 
38
38
  ## Features
@@ -103,9 +103,9 @@ db2.pragma(journal_mode: :wal, synchronous: 1)
103
103
  db3 = Extralite::Database.new(fn)
104
104
  db3.pragma(journal_mode: :wal, synchronous: 1)
105
105
 
106
- db1.on_progress(1000) { |b| b ? sleep(0.0001) : snooze }
107
- db2.on_progress(1000) { |b| b ? sleep(0.0001) : snooze }
108
- db3.on_progress(1000) { |b| b ? sleep(0.0001) : snooze }
106
+ db1.on_progress { |b| b ? sleep(0.0001) : snooze }
107
+ db2.on_progress { |b| b ? sleep(0.0001) : snooze }
108
+ db3.on_progress { |b| b ? sleep(0.0001) : snooze }
109
109
 
110
110
  producer = PubSub.new(db1)
111
111
  producer.setup
@@ -163,7 +163,7 @@ end
163
163
 
164
164
  db4 = Extralite::Database.new(fn)
165
165
  db4.pragma(journal_mode: :wal, synchronous: 1)
166
- db4.on_progress(1000) { |busy| busy ? sleep(0.05) : snooze }
166
+ db4.on_progress { |busy| busy ? sleep(0.05) : snooze }
167
167
 
168
168
  last_t = Time.now
169
169
  last_publish_count = 0
@@ -175,7 +175,7 @@ while true
175
175
  d_publish = publish_count - last_publish_count
176
176
  d_receive = receive_count - last_receive_count
177
177
  pending = db4.query_single_splat('select count(*) from messages')
178
- puts "#{Time.now} publish: #{d_publish/elapsed}/s receive: #{d_receive/elapsed}/s pending: #{pending}"
178
+ puts "#{Time.now} publish: #{(d_publish/elapsed).round}/s receive: #{(d_receive/elapsed).round}/s pending: #{pending} latency: #{pending / (d_receive/elapsed)}"
179
179
  last_t = now
180
180
  last_publish_count = publish_count
181
181
  last_receive_count = receive_count
@@ -294,6 +294,8 @@ static inline VALUE Database_perform_query(int argc, VALUE *argv, VALUE self, VA
294
294
  prepare_multi_stmt(DB_GVL_MODE(db), db->sqlite3_db, &stmt, sql);
295
295
  RB_GC_GUARD(sql);
296
296
 
297
+ if (stmt == NULL) return Qnil;
298
+
297
299
  bind_all_parameters(stmt, argc - 1, argv + 1);
298
300
  query_ctx ctx = QUERY_CTX(
299
301
  self, sql, db, stmt, Qnil, transform,
@@ -485,6 +487,10 @@ VALUE Database_query_single_array(int argc, VALUE *argv, VALUE self) {
485
487
  * specified using keyword arguments:
486
488
  *
487
489
  * db.execute('update foo set x = :bar', bar: 42)
490
+ *
491
+ * @param sql [String] query SQL
492
+ * @param parameters [Array, Hash] parameters to run query with
493
+ * @return [Integer, nil] Total number of changes effected or `nil` if the query ends with a comment.
488
494
  */
489
495
  VALUE Database_execute(int argc, VALUE *argv, VALUE self) {
490
496
  return Database_perform_query(argc, argv, self, safe_query_changes, QUERY_HASH);