Skip to content

Commit 59eee1d

Browse files
committed
version bump to v2.0.0
1 parent 6a2f56c commit 59eee1d

File tree

3 files changed

+121
-57
lines changed

3 files changed

+121
-57
lines changed

CHANGELOG.md

Lines changed: 107 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
# sqlite3-ruby Changelog
22

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.
48

5-
(will be 2.0.0)
69

710
### Ruby
811

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
1043

1144

1245
### Added
@@ -40,67 +73,90 @@ This release drops support for Ruby 2.7. [#453] @flavorjones
4073

4174
### Removed
4275

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
72106
end
73107
end
74108
end
75-
end
76109

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
81115
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
84120

85-
- Removed `types` and `fields` readers on row objects.
86121
Deprecated code looks like this:
87122

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+
```
92127

93128
If you would like to access the "types" associated with a returned query,
94129
use a prepared statement like this:
95130

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
101158

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
104160

105161

106162
## 1.7.2 / 2024-01-30

INSTALLATION.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ This document will help you install the `sqlite3` ruby gem. It also contains ins
77

88
### Native Gems (recommended)
99

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:
1111

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`
1416
- `arm64-darwin`
1517
- `x64-mingw32` / `x64-mingw-ucrt`
16-
- `x86-linux` (requires: glibc >= 2.17)
18+
- `x86-linux-gnu` (requires: glibc >= 2.17)
19+
- `x86-linux-musl`
1720
- `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
1927

2028
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.
2129

lib/sqlite3/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SQLite3
2-
VERSION = "2.0.0.dev"
2+
VERSION = "2.0.0"
33
end

0 commit comments

Comments
 (0)