sqlite3 1.7.3-x86_64-darwin → 2.0.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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -0
  3. data/CONTRIBUTING.md +23 -1
  4. data/FAQ.md +0 -43
  5. data/INSTALLATION.md +13 -5
  6. data/LICENSE +18 -22
  7. data/README.md +75 -4
  8. data/dependencies.yml +10 -11
  9. data/ext/sqlite3/aggregator.c +142 -145
  10. data/ext/sqlite3/aggregator.h +2 -4
  11. data/ext/sqlite3/backup.c +74 -65
  12. data/ext/sqlite3/backup.h +2 -2
  13. data/ext/sqlite3/database.c +535 -482
  14. data/ext/sqlite3/database.h +7 -4
  15. data/ext/sqlite3/exception.c +111 -92
  16. data/ext/sqlite3/exception.h +3 -1
  17. data/ext/sqlite3/extconf.rb +21 -22
  18. data/ext/sqlite3/sqlite3.c +159 -115
  19. data/ext/sqlite3/sqlite3_ruby.h +2 -2
  20. data/ext/sqlite3/statement.c +516 -300
  21. data/ext/sqlite3/statement.h +3 -3
  22. data/ext/sqlite3/timespec.h +20 -0
  23. data/lib/sqlite3/3.0/sqlite3_native.bundle +0 -0
  24. data/lib/sqlite3/3.1/sqlite3_native.bundle +0 -0
  25. data/lib/sqlite3/3.2/sqlite3_native.bundle +0 -0
  26. data/lib/sqlite3/3.3/sqlite3_native.bundle +0 -0
  27. data/lib/sqlite3/constants.rb +171 -47
  28. data/lib/sqlite3/database.rb +105 -165
  29. data/lib/sqlite3/errors.rb +26 -1
  30. data/lib/sqlite3/pragmas.rb +126 -136
  31. data/lib/sqlite3/resultset.rb +14 -97
  32. data/lib/sqlite3/statement.rb +58 -13
  33. data/lib/sqlite3/value.rb +17 -20
  34. data/lib/sqlite3/version.rb +1 -21
  35. data/lib/sqlite3.rb +6 -4
  36. metadata +3 -28
  37. data/API_CHANGES.md +0 -49
  38. data/ChangeLog.cvs +0 -88
  39. data/Gemfile +0 -10
  40. data/LICENSE-DEPENDENCIES +0 -20
  41. data/lib/sqlite3/translator.rb +0 -117
  42. data/test/helper.rb +0 -27
  43. data/test/test_backup.rb +0 -33
  44. data/test/test_collation.rb +0 -82
  45. data/test/test_database.rb +0 -668
  46. data/test/test_database_flags.rb +0 -95
  47. data/test/test_database_readonly.rb +0 -36
  48. data/test/test_database_readwrite.rb +0 -41
  49. data/test/test_deprecated.rb +0 -49
  50. data/test/test_encoding.rb +0 -165
  51. data/test/test_integration.rb +0 -507
  52. data/test/test_integration_aggregate.rb +0 -336
  53. data/test/test_integration_open_close.rb +0 -30
  54. data/test/test_integration_pending.rb +0 -115
  55. data/test/test_integration_resultset.rb +0 -142
  56. data/test/test_integration_statement.rb +0 -194
  57. data/test/test_pragmas.rb +0 -22
  58. data/test/test_result_set.rb +0 -47
  59. data/test/test_sqlite3.rb +0 -30
  60. data/test/test_statement.rb +0 -290
  61. data/test/test_statement_execute.rb +0 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb0c8f28833d6335b56de294ec1ccb7de086d3dbc3fac73a964a793e8e51c269
4
- data.tar.gz: 8c48a3ba8e28c760f0919cad924efd494a255fb60236bf195a6e13e078c29df1
3
+ metadata.gz: 8ba31e87620deefe36bb2799abbbf2566ff78d5199b59964fa039b696924a668
4
+ data.tar.gz: 123c18497bda5921b77870e6f1a8cfcdaa6cc3b43d03f3643d1b0bc9b1bb6ab7
5
5
  SHA512:
6
- metadata.gz: c422045e59c9d444d7a0fb6369d41ea33d2a5564711e7348a01603b8cbbafbe40cbf7470b44311f9451036507190820fa9de7e3f2bc6fb5d30785b3bd5678c43
7
- data.tar.gz: e866959f27a369097dc211a69c502326dd78dabb111f76f4873f8ee94449cca69e7426544548136fc4e3e1d41c712fec95879552958b0487482288efdfa28d64
6
+ metadata.gz: 6e8df27128861f48b28d8b29ecf6ceff229975573ff11a6de9cde71f417f3e0b15707b5f0b024e31e5e442940d2b65a0a23b2d6ff53ba1e9ffc916a5b52639a5
7
+ data.tar.gz: e605d14919ba594f25a5755d7990985b0b84ede4139524eac4e1b2075bc222fe8135e1ecc976c726e43848ac06f428286560fca308f625aa0a727657b05253a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,157 @@
1
1
  # sqlite3-ruby Changelog
2
2
 
3
+ ## 2.0.0 / 2024-04-17
4
+
5
+ This is a major release which contains some breaking changes, primarily the removal of
6
+ long-deprecated functionality. Before upgrading, please make sure to address deprecation warnings
7
+ emitted from your application using sqlite3-ruby v1.7.x.
8
+
9
+
10
+ ### Ruby
11
+
12
+ - This release drops support for Ruby 2.7. [#453] @flavorjones
13
+
14
+
15
+ ### Packaging
16
+
17
+ Native (precompiled) gems are now available for Linux Musl. [#442] @flavorjones
18
+
19
+ Here are the platforms for which native gems are shipped:
20
+
21
+ - `aarch64-linux-gnu` (requires: glibc >= 2.29)
22
+ - `aarch64-linux-musl`
23
+ - `arm-linux-gnu` (requires: glibc >= 2.29)
24
+ - `arm-linux-musl`
25
+ - `arm64-darwin`
26
+ - `x64-mingw32` / `x64-mingw-ucrt`
27
+ - `x86-linux-gnu` (requires: glibc >= 2.17)
28
+ - `x86-linux-musl`
29
+ - `x86_64-darwin`
30
+ - `x86_64-linux-gnu` (requires: glibc >= 2.17)
31
+ - `x86_64-linux-musl`
32
+
33
+ ⚠ Ruby 3.0 linux users must use Rubygems >= 3.3.22 in order to use these gems.
34
+
35
+ ⚠ Musl linux users should update to Bundler >= 2.5.6 to avoid https://github.com/rubygems/rubygems/issues/7432
36
+
37
+ See [the INSTALLATION doc](https://github.com/sparklemotion/sqlite3-ruby/blob/main/INSTALLATION.md) for more information.
38
+
39
+
40
+ ### Dependencies
41
+
42
+ - Vendored sqlite is updated to [v3.45.3](https://sqlite.org/releaselog/3_45_3.html). @flavorjones
43
+
44
+
45
+ ### Added
46
+
47
+ - `Database#busy_handler_timeout=` introduced as an alternative to `#busy_timeout=` that can be used when it's desired to release the GVL between retries. [#443, #456] @fractaledmind
48
+ - Support the `SUPER_JOURNAL` flag which is an alias for `MASTER_JOURNAL` as of sqlite 3.33.0. [#467] @flavorjones
49
+ - `Statement#stat` and `Statement#memused` introduced to report statistics. [#461] @fractaledmind
50
+ - `Statement#sql` and `Statement#expanded_sql` introduced to retrieve the SQL statement associated with the `Statement` object. [#293, #498] @tenderlove
51
+ - `SQLite3.status` introduced to return run-time status and reset high-water marks. See `SQLite3::Constants::Status` for details. [#520] @wjlroe
52
+
53
+
54
+ ### Improved
55
+
56
+ - Avoid leaking memory for statements that are not closed properly. [#392] @haileys
57
+ - Moved some C code into Ruby. [#451, #455] @tenderlove
58
+ - Improve performance of `ResultSet` hashes. [#154, #484, #468] @tenderlove
59
+ - Fix a GC compaction issue with `busy_handler`. [#466] @byroot
60
+ - Remove unused `ResultSet` instance variable. [#469] @tenderlove
61
+ - Fix encoding for values passed to custom functions. [#218, #488] @tenderlove
62
+
63
+
64
+ ### Changed
65
+
66
+ - Consistently use `SQLite3::Exception` or subclasses. Previously some `Pragmas` methods raised `Exception`, and `Database#execute_batch2` and `Database#load_extension` raised `RuntimeError`. [#467, #490] @flavorjones
67
+ - `Database#columns` returns a list of internal frozen strings. [#155, #474, #486] @tenderlove
68
+ - Freeze results that come from the database. [#480] @tenderlove
69
+ - The encoding of a Database is no longer cached. [#485] @tenderlove
70
+ - `Database#transaction` returns the result of the block when used with a block. [#508] @alexcwatt
71
+ - `Database#execute_batch` returns the result of the last statement executed. [#512] @alexcwatt
72
+
73
+
74
+ ### Removed
75
+
76
+ - Removed class `SQLite3::Translator` and all related type translation methods which have been deprecated since v1.3.2. [#470] @tenderlove
77
+
78
+ If you need to do type translation on values returned from the statement object, please wrap it
79
+ with a delegate object. Here is an example of using a delegate class to implement type
80
+ translation:
81
+
82
+ ```ruby
83
+ require "sqlite3"
84
+ require "delegate"
85
+
86
+ db = SQLite3::Database.new(":memory:")
87
+
88
+ return_value = db.execute_batch2 <<-EOSQL
89
+ CREATE TABLE items (id integer PRIMARY KEY AUTOINCREMENT, name string);
90
+ INSERT INTO items (name) VALUES ("foo");
91
+ INSERT INTO items (name) VALUES ("bar");
92
+ EOSQL
93
+
94
+ class MyTranslator < DelegateClass(SQLite3::Statement)
95
+ def step
96
+ row = super
97
+ return if done?
98
+
99
+ row.map.with_index do |item, i|
100
+ case types[i]
101
+ when "integer" # turn all integers to floats
102
+ item.to_f
103
+ when "string" # add "hello" to all strings
104
+ item + "hello"
105
+ end
106
+ end
107
+ end
108
+ end
109
+
110
+ db.prepare("SELECT * FROM items") do |stmt|
111
+ stmt = MyTranslator.new(stmt)
112
+ while row = stmt.step
113
+ p row
114
+ end
115
+ end
116
+ ```
117
+
118
+ - Removed `types` and `fields` readers on row objects, which have been deprecated since
119
+ v1.3.6. [#471] @tenderlove
120
+
121
+ Deprecated code looks like this:
122
+
123
+ ```ruby
124
+ row = @db.execute("select * from foo")
125
+ assert_equal ["blob"], row.first.types
126
+ ```
127
+
128
+ If you would like to access the "types" associated with a returned query,
129
+ use a prepared statement like this:
130
+
131
+ ```ruby
132
+ @db.prepare("select * from foo") do |v|
133
+ assert_equal ["blob"], v.types
134
+ end
135
+ ```
136
+
137
+ - Removed support for non-Array bind parameters to methods `Database#execute`, `#execute_batch`, and `#query`, which has been deprecated since v1.3.0. [#511] @flavorjones
138
+
139
+ Deprecated code looks like this:
140
+
141
+ ``` ruby
142
+ @db.query("select * from foo where a = ? and b = ? and c = ?", 1, 2, 3)
143
+ ```
144
+
145
+ For these cases, pass the bind parameters as an array:
146
+
147
+ ``` ruby
148
+ @db.query("select * from foo where a = ? and b = ? and c = ?", [1, 2, 3])
149
+ ```
150
+
151
+ - Removed class `SQLite3::VersionProxy` which has been deprecated since v1.3.2. [#453] @flavorjones
152
+ - Removed methods `SQLite3::Database::FunctionProxy#count` and `#set_error` which have been broken since at least v1.3.13. [#164, #509, #510] @alexcwatt @flavorjones
153
+
154
+
3
155
  ## 1.7.3 / 2024-03-15
4
156
 
5
157
  ### Dependencies
data/CONTRIBUTING.md CHANGED
@@ -5,6 +5,28 @@
5
5
  This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.
6
6
 
7
7
 
8
+ ## Architecture notes
9
+
10
+ ### Garbage collection
11
+
12
+ All statements keep pointers back to their respective database connections.
13
+ The `@connection` instance variable on the `Statement` handle keeps the database
14
+ connection alive. Memory allocated for a statement handler will be freed in
15
+ two cases:
16
+
17
+ 1. `#close` is called on the statement
18
+ 2. The `SQLite3::Database` object gets garbage collected
19
+
20
+ We can't free the memory for the statement in the garbage collection function
21
+ for the statement handler. The reason is because there exists a race
22
+ condition. We cannot guarantee the order in which objects will be garbage
23
+ collected. So, it is possible that a connection and a statement are up for
24
+ garbage collection. If the database connection were to be free'd before the
25
+ statement, then boom. Instead we'll be conservative and free unclosed
26
+ statements when the connection is terminated.
27
+
28
+
29
+
8
30
  ## Building gems
9
31
 
10
32
  As a prerequisite please make sure you have `docker` correctly installed, so that you're able to cross-compile the native gems.
@@ -26,7 +48,7 @@ Update `/dependencies.yml` to reflect:
26
48
  A quick checklist:
27
49
 
28
50
  - [ ] make sure CI is green!
29
- - [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb` including `VersionProxy::{MINOR,TINY}`
51
+ - [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb`
30
52
  - [ ] run `bin/build-gems` and make sure it completes and all the tests pass
31
53
  - [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
32
54
  - [ ] `git push && git push --tags`
data/FAQ.md CHANGED
@@ -289,49 +289,6 @@ by column name, even though they are still arrays!
289
289
  end
290
290
  ```
291
291
 
292
- ## I'd like the values from a query to be the correct types, instead of String.
293
-
294
- You can turn on "type translation" by setting `Database#type_translation` to
295
- true:
296
-
297
-
298
- ```ruby
299
- db.type_translation = true
300
- db.execute( "select * from table" ) do |row|
301
- p row
302
- end
303
- ```
304
-
305
-
306
- By doing this, each return value for each row will be translated to its
307
- correct type, based on its declared column type.
308
-
309
-
310
- You can even declare your own translation routines, if (for example) you are
311
- using an SQL type that is not handled by default:
312
-
313
-
314
- ```ruby
315
- # assume "objects" table has the following schema:
316
- # create table objects (
317
- # name varchar2(20),
318
- # thing object
319
- # )
320
-
321
- db.type_translation = true
322
- db.translator.add_translator( "object" ) do |type, value|
323
- db.decode( value )
324
- end
325
-
326
- h = { :one=>:two, "three"=>"four", 5=>6 }
327
- dump = db.encode( h )
328
-
329
- db.execute( "insert into objects values ( ?, ? )", "bob", dump )
330
-
331
- obj = db.get_first_value( "select thing from objects where name='bob'" )
332
- p obj == h
333
- ```
334
-
335
292
  ## How do I insert binary data into the database?
336
293
 
337
294
  Use blobs. Blobs are new features of SQLite3. You have to use bind
data/INSTALLATION.md CHANGED
@@ -7,15 +7,23 @@ 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 v1.5.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
10
+ In v2.0.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
11
11
 
12
- - `aarch64-linux` (requires: glibc >= 2.29)
13
- - `arm-linux` (requires: glibc >= 2.29)
12
+ - `aarch64-linux-gnu` (requires: glibc >= 2.29)
13
+ - `aarch64-linux-musl`
14
+ - `arm-linux-gnu` (requires: glibc >= 2.29)
15
+ - `arm-linux-musl`
14
16
  - `arm64-darwin`
15
17
  - `x64-mingw32` / `x64-mingw-ucrt`
16
- - `x86-linux` (requires: glibc >= 2.17)
18
+ - `x86-linux-gnu` (requires: glibc >= 2.17)
19
+ - `x86-linux-musl`
17
20
  - `x86_64-darwin`
18
- - `x86_64-linux` (requires: glibc >= 2.17)
21
+ - `x86_64-linux-gnu` (requires: glibc >= 2.17)
22
+ - `x86_64-linux-musl`
23
+
24
+ ⚠ Ruby 3.0 linux users must use Rubygems >= 3.3.22 in order to use these gems.
25
+
26
+ ⚠ Musl linux users should update to Bundler >= 2.5.6 to avoid https://github.com/rubygems/rubygems/issues/7432
19
27
 
20
28
  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.
21
29
 
data/LICENSE CHANGED
@@ -1,27 +1,23 @@
1
- Copyright (c) 2004, Jamis Buck (jamis@jamisbuck.org)
2
- All rights reserved.
1
+ Copyright (c) 2004-2024, Jamis Buck, Luis Lavena, Aaron Patterson, Mike Dalessio, et al.
3
2
 
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted
4
+ provided that the following conditions are met:
6
5
 
7
- * Redistributions of source code must retain the above copyright notice,
8
- this list of conditions and the following disclaimer.
6
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions
7
+ and the following disclaimer.
9
8
 
10
- * Redistributions in binary form must reproduce the above copyright
11
- notice, this list of conditions and the following disclaimer in the
12
- documentation and/or other materials provided with the distribution.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
10
+ conditions and the following disclaimer in the documentation and/or other materials provided with
11
+ the distribution.
13
12
 
14
- * The names of its contributors may not be used to endorse or promote
15
- products derived from this software without specific prior written
16
- permission.
13
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to
14
+ endorse or promote products derived from this software without specific prior written permission.
17
15
 
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
17
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
19
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
23
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -11,8 +11,7 @@ Note that this module is only compatible with SQLite 3.6.16 or newer.
11
11
  * Download: http://rubygems.org/gems/sqlite3
12
12
  * Documentation: http://www.rubydoc.info/gems/sqlite3
13
13
 
14
- [![Unit tests](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/sqlite3-ruby.yml/badge.svg)](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/sqlite3-ruby.yml)
15
- [![Native packages](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/gem-install.yml/badge.svg)](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/gem-install.yml)
14
+ [![Test suite](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/ci.yml)
16
15
 
17
16
 
18
17
  ## Quick start
@@ -77,6 +76,78 @@ end
77
76
  # => ["Jane", "me@janedoe.com", "A", "http://blog.janedoe.com"]
78
77
  ```
79
78
 
79
+ ## Thread Safety
80
+
81
+ When `SQLite3.threadsafe?` returns `true`, then SQLite3 has been compiled to
82
+ support running in a multithreaded environment. However, this doesn't mean
83
+ that all classes in the SQLite3 gem can be considered "thread safe".
84
+
85
+ When `SQLite3.threadsafe?` returns `true`, it is safe to share only
86
+ `SQLite3::Database` instances among threads without providing your own locking
87
+ mechanism. For example, the following code is fine because only the database
88
+ instance is shared among threads:
89
+
90
+ ```ruby
91
+ require 'sqlite3'
92
+
93
+ db = SQLite3::Database.new ":memory:"
94
+
95
+ latch = Queue.new
96
+
97
+ ts = 10.times.map {
98
+ Thread.new {
99
+ latch.pop
100
+ db.execute "SELECT '#{Thread.current.inspect}'"
101
+ }
102
+ }
103
+ 10.times { latch << nil }
104
+
105
+ p ts.map(&:value)
106
+ ```
107
+
108
+ Other instances can be shared among threads, but they require that you provide
109
+ your own locking for thread safety. For example, `SQLite3::Statement` objects
110
+ (prepared statements) are mutable, so applications must take care to add
111
+ appropriate locks to avoid data race conditions when sharing these objects
112
+ among threads.
113
+
114
+ Lets rewrite the above example but use a prepared statement and safely share
115
+ the prepared statement among threads:
116
+
117
+ ```ruby
118
+ db = SQLite3::Database.new ":memory:"
119
+
120
+ # Prepare a statement
121
+ stmt = db.prepare "SELECT :inspect"
122
+ stmt_lock = Mutex.new
123
+
124
+ latch = Queue.new
125
+
126
+ ts = 10.times.map {
127
+ Thread.new {
128
+ latch.pop
129
+
130
+ # Add a lock when using the prepared statement.
131
+ # Binding values, and walking over results will mutate the statement, so
132
+ # in order to prevent other threads from "seeing" this thread's data, we
133
+ # must lock when using the statement object
134
+ stmt_lock.synchronize do
135
+ stmt.execute(Thread.current.inspect).to_a
136
+ end
137
+ }
138
+ }
139
+
140
+ 10.times { latch << nil }
141
+
142
+ p ts.map(&:value)
143
+
144
+ stmt.close
145
+ ```
146
+
147
+ It is generally recommended that if applications want to share a database among
148
+ threads, they _only_ share the database instance object. Other objects are
149
+ fine to share, but may require manual locking for thread safety.
150
+
80
151
  ## Support
81
152
 
82
153
  ### Installation or database extensions
@@ -104,7 +175,7 @@ See [`CONTRIBUTING.md`](./CONTRIBUTING.md).
104
175
 
105
176
  This library is licensed under `BSD-3-Clause`, see [`LICENSE`](./LICENSE).
106
177
 
107
-
108
178
  ### Dependencies
109
179
 
110
- The source code of `sqlite` is distributed in the "ruby platform" gem. This code is public domain, see [`LICENSE-DEPENDENCIES`](./LICENSE-DEPENDENCIES) for details.
180
+ The source code of `sqlite` is distributed in the "ruby platform" gem. This code is public domain,
181
+ see https://www.sqlite.org/copyright.html for details.
data/dependencies.yml CHANGED
@@ -1,14 +1,13 @@
1
- # TODO: stop using symbols here once we no longer support Ruby 2.7 and can rely on symbolize_names
2
- :sqlite3:
1
+ sqlite3:
3
2
  # checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
4
- # 1b02c58a711d15b50da8a1089e0f8807ebbdf3e674c714100eda9a03a69ac758
3
+ # cc1050780e0266de4d91b31c8deaf4638336908c12c21898e9f1fcae1e2ac303
5
4
  #
6
- # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3450200.tar.gz
7
- # 1b02c58a711d15b50da8a1089e0f8807ebbdf3e674c714100eda9a03a69ac758 ports/archives/sqlite-autoconf-3450200.tar.gz
5
+ # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3450300.tar.gz
6
+ # cc1050780e0266de4d91b31c8deaf4638336908c12c21898e9f1fcae1e2ac303 ports/archives/sqlite-autoconf-3450300.tar.gz
8
7
  #
9
- # $ sha256sum ports/archives/sqlite-autoconf-3450200.tar.gz
10
- # bc9067442eedf3dd39989b5c5cfbfff37ae66cc9c99274e0c3052dc4d4a8f6ae ports/archives/sqlite-autoconf-3450200.tar.gz
11
- :version: "3.45.2"
12
- :files:
13
- - :url: "https://sqlite.org/2024/sqlite-autoconf-3450200.tar.gz"
14
- :sha256: "bc9067442eedf3dd39989b5c5cfbfff37ae66cc9c99274e0c3052dc4d4a8f6ae"
8
+ # $ sha256sum ports/archives/sqlite-autoconf-3450300.tar.gz
9
+ # b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531 ports/archives/sqlite-autoconf-3450300.tar.gz
10
+ version: "3.45.3"
11
+ files:
12
+ - url: "https://sqlite.org/2024/sqlite-autoconf-3450300.tar.gz"
13
+ sha256: "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"