|
1 | 1 | # sqlite3-ruby Changelog |
2 | 2 |
|
3 | | -## next / unreleased |
| 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. |
4 | 8 |
|
5 | | -(will be 2.0.0) |
6 | 9 |
|
7 | 10 | ### Ruby |
8 | 11 |
|
9 | | -This release drops support for Ruby 2.7. [#453] @flavorjones |
| 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 |
10 | 43 |
|
11 | 44 |
|
12 | 45 | ### Added |
@@ -40,67 +73,90 @@ This release drops support for Ruby 2.7. [#453] @flavorjones |
40 | 73 |
|
41 | 74 | ### Removed |
42 | 75 |
|
43 | | -- Removed class `SQLite3::VersionProxy` which has been deprecated since v1.3.2. [#453] @flavorjones |
44 | | -- Removed class `SQLite3::Translator` and all related type translation methods. |
45 | | - If you need to do type translation on values returned from the statement object, |
46 | | - please wrap it with a delegate object. Here is an example of using a delegate |
47 | | - class to implement type translation: |
48 | | - |
49 | | -```ruby |
50 | | -require "sqlite3" |
51 | | -require "delegate" |
52 | | - |
53 | | -db = SQLite3::Database.new(":memory:") |
54 | | - |
55 | | -return_value = db.execute_batch2 <<-EOSQL |
56 | | - CREATE TABLE items (id integer PRIMARY KEY AUTOINCREMENT, name string); |
57 | | - INSERT INTO items (name) VALUES ("foo"); |
58 | | - INSERT INTO items (name) VALUES ("bar"); |
59 | | -EOSQL |
60 | | - |
61 | | -class MyTranslator < DelegateClass(SQLite3::Statement) |
62 | | - def step |
63 | | - row = super |
64 | | - return if done? |
65 | | - |
66 | | - row.map.with_index do |item, i| |
67 | | - case types[i] |
68 | | - when "integer" # turn all integers to floats |
69 | | - item.to_f |
70 | | - when "string" # add "hello" to all strings |
71 | | - item + "hello" |
| 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 |
72 | 106 | end |
73 | 107 | end |
74 | 108 | end |
75 | | -end |
76 | 109 |
|
77 | | -db.prepare("SELECT * FROM items") do |stmt| |
78 | | - stmt = MyTranslator.new(stmt) |
79 | | - while row = stmt.step |
80 | | - p row |
| 110 | + db.prepare("SELECT * FROM items") do |stmt| |
| 111 | + stmt = MyTranslator.new(stmt) |
| 112 | + while row = stmt.step |
| 113 | + p row |
| 114 | + end |
81 | 115 | end |
82 | | -end |
83 | | -``` |
| 116 | + ``` |
| 117 | + |
| 118 | +- Removed `types` and `fields` readers on row objects, which have been deprecated since |
| 119 | + v1.3.6. [#471] @tenderlove |
84 | 120 |
|
85 | | -- Removed `types` and `fields` readers on row objects. |
86 | 121 | Deprecated code looks like this: |
87 | 122 |
|
88 | | -```ruby |
89 | | -row = @db.execute("select * from foo") |
90 | | -assert_equal ["blob"], row.first.types |
91 | | -``` |
| 123 | + ```ruby |
| 124 | + row = @db.execute("select * from foo") |
| 125 | + assert_equal ["blob"], row.first.types |
| 126 | + ``` |
92 | 127 |
|
93 | 128 | If you would like to access the "types" associated with a returned query, |
94 | 129 | use a prepared statement like this: |
95 | 130 |
|
96 | | -```ruby |
97 | | -@db.prepare("select * from foo") do |v| |
98 | | - assert_equal ["blob"], v.types |
99 | | -end |
100 | | -``` |
| 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 | + |
| 155 | +## 1.7.3 / 2024-03-15 |
| 156 | + |
| 157 | +### Dependencies |
101 | 158 |
|
102 | | -- Removed methods `SQLite3::Database::FunctionProxy#count` and `#set_error`. [#164, #509, #510] @alexcwatt @flavorjones |
103 | | -- Removed support for non-Array bind parameters to methods `Database#execute`, `#execute_batch`, and `#query`. |
| 159 | +- Vendored sqlite is updated to [v3.45.2](https://www.sqlite.org/releaselog/3_45_2.html). @flavorjones |
104 | 160 |
|
105 | 161 |
|
106 | 162 | ## 1.7.2 / 2024-01-30 |
|
0 commit comments