From 59eee1d007a80930a36410983f60594814b4d619 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 17 Apr 2024 12:33:04 -0400 Subject: [PATCH] version bump to v2.0.0 --- CHANGELOG.md | 158 ++++++++++++++++++++++++++++------------- INSTALLATION.md | 18 +++-- lib/sqlite3/version.rb | 2 +- 3 files changed, 121 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 863695df..400a7855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,45 @@ # sqlite3-ruby Changelog -## next / unreleased +## 2.0.0 / 2024-04-17 + +This is a major release which contains some breaking changes, primarily the removal of +long-deprecated functionality. Before upgrading, please make sure to address deprecation warnings +emitted from your application using sqlite3-ruby v1.7.x. -(will be 2.0.0) ### Ruby -This release drops support for Ruby 2.7. [#453] @flavorjones +- This release drops support for Ruby 2.7. [#453] @flavorjones + + +### Packaging + +Native (precompiled) gems are now available for Linux Musl. [#442] @flavorjones + +Here are the platforms for which native gems are shipped: + +- `aarch64-linux-gnu` (requires: glibc >= 2.29) +- `aarch64-linux-musl` +- `arm-linux-gnu` (requires: glibc >= 2.29) +- `arm-linux-musl` +- `arm64-darwin` +- `x64-mingw32` / `x64-mingw-ucrt` +- `x86-linux-gnu` (requires: glibc >= 2.17) +- `x86-linux-musl` +- `x86_64-darwin` +- `x86_64-linux-gnu` (requires: glibc >= 2.17) +- `x86_64-linux-musl` + +⚠ Ruby 3.0 linux users must use Rubygems >= 3.3.22 in order to use these gems. + +⚠ Musl linux users should update to Bundler >= 2.5.6 to avoid https://github.com/rubygems/rubygems/issues/7432 + +See [the INSTALLATION doc](https://github.com/sparklemotion/sqlite3-ruby/blob/main/INSTALLATION.md) for more information. + + +### Dependencies + +- Vendored sqlite is updated to [v3.45.3](https://sqlite.org/releaselog/3_45_3.html). @flavorjones ### Added @@ -40,67 +73,90 @@ This release drops support for Ruby 2.7. [#453] @flavorjones ### Removed -- Removed class `SQLite3::VersionProxy` which has been deprecated since v1.3.2. [#453] @flavorjones -- Removed class `SQLite3::Translator` and all related type translation methods. - If you need to do type translation on values returned from the statement object, - please wrap it with a delegate object. Here is an example of using a delegate - class to implement type translation: - -```ruby -require "sqlite3" -require "delegate" - -db = SQLite3::Database.new(":memory:") - -return_value = db.execute_batch2 <<-EOSQL - CREATE TABLE items (id integer PRIMARY KEY AUTOINCREMENT, name string); - INSERT INTO items (name) VALUES ("foo"); - INSERT INTO items (name) VALUES ("bar"); -EOSQL - -class MyTranslator < DelegateClass(SQLite3::Statement) - def step - row = super - return if done? - - row.map.with_index do |item, i| - case types[i] - when "integer" # turn all integers to floats - item.to_f - when "string" # add "hello" to all strings - item + "hello" +- Removed class `SQLite3::Translator` and all related type translation methods which have been deprecated since v1.3.2. [#470] @tenderlove + + If you need to do type translation on values returned from the statement object, please wrap it + with a delegate object. Here is an example of using a delegate class to implement type + translation: + + ```ruby + require "sqlite3" + require "delegate" + + db = SQLite3::Database.new(":memory:") + + return_value = db.execute_batch2 <<-EOSQL + CREATE TABLE items (id integer PRIMARY KEY AUTOINCREMENT, name string); + INSERT INTO items (name) VALUES ("foo"); + INSERT INTO items (name) VALUES ("bar"); + EOSQL + + class MyTranslator < DelegateClass(SQLite3::Statement) + def step + row = super + return if done? + + row.map.with_index do |item, i| + case types[i] + when "integer" # turn all integers to floats + item.to_f + when "string" # add "hello" to all strings + item + "hello" + end end end end -end -db.prepare("SELECT * FROM items") do |stmt| - stmt = MyTranslator.new(stmt) - while row = stmt.step - p row + db.prepare("SELECT * FROM items") do |stmt| + stmt = MyTranslator.new(stmt) + while row = stmt.step + p row + end end -end -``` + ``` + +- Removed `types` and `fields` readers on row objects, which have been deprecated since + v1.3.6. [#471] @tenderlove -- Removed `types` and `fields` readers on row objects. Deprecated code looks like this: -```ruby -row = @db.execute("select * from foo") -assert_equal ["blob"], row.first.types -``` + ```ruby + row = @db.execute("select * from foo") + assert_equal ["blob"], row.first.types + ``` If you would like to access the "types" associated with a returned query, use a prepared statement like this: -```ruby -@db.prepare("select * from foo") do |v| - assert_equal ["blob"], v.types -end -``` + ```ruby + @db.prepare("select * from foo") do |v| + assert_equal ["blob"], v.types + end + ``` + +- 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 + + Deprecated code looks like this: + + ``` ruby + @db.query("select * from foo where a = ? and b = ? and c = ?", 1, 2, 3) + ``` + + For these cases, pass the bind parameters as an array: + + ``` ruby + @db.query("select * from foo where a = ? and b = ? and c = ?", [1, 2, 3]) + ``` + +- Removed class `SQLite3::VersionProxy` which has been deprecated since v1.3.2. [#453] @flavorjones +- Removed methods `SQLite3::Database::FunctionProxy#count` and `#set_error` which have been broken since at least v1.3.13. [#164, #509, #510] @alexcwatt @flavorjones + + +## 1.7.3 / 2024-03-15 + +### Dependencies -- Removed methods `SQLite3::Database::FunctionProxy#count` and `#set_error`. [#164, #509, #510] @alexcwatt @flavorjones -- Removed support for non-Array bind parameters to methods `Database#execute`, `#execute_batch`, and `#query`. +- Vendored sqlite is updated to [v3.45.2](https://www.sqlite.org/releaselog/3_45_2.html). @flavorjones ## 1.7.2 / 2024-01-30 diff --git a/INSTALLATION.md b/INSTALLATION.md index 138153ac..fa002fd7 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -7,15 +7,23 @@ This document will help you install the `sqlite3` ruby gem. It also contains ins ### Native Gems (recommended) -In v1.5.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms: +In v2.0.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms: -- `aarch64-linux` (requires: glibc >= 2.29) -- `arm-linux` (requires: glibc >= 2.29) +- `aarch64-linux-gnu` (requires: glibc >= 2.29) +- `aarch64-linux-musl` +- `arm-linux-gnu` (requires: glibc >= 2.29) +- `arm-linux-musl` - `arm64-darwin` - `x64-mingw32` / `x64-mingw-ucrt` -- `x86-linux` (requires: glibc >= 2.17) +- `x86-linux-gnu` (requires: glibc >= 2.17) +- `x86-linux-musl` - `x86_64-darwin` -- `x86_64-linux` (requires: glibc >= 2.17) +- `x86_64-linux-gnu` (requires: glibc >= 2.17) +- `x86_64-linux-musl` + +⚠ Ruby 3.0 linux users must use Rubygems >= 3.3.22 in order to use these gems. + +⚠ Musl linux users should update to Bundler >= 2.5.6 to avoid https://github.com/rubygems/rubygems/issues/7432 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. diff --git a/lib/sqlite3/version.rb b/lib/sqlite3/version.rb index d582902b..20f05f08 100644 --- a/lib/sqlite3/version.rb +++ b/lib/sqlite3/version.rb @@ -1,3 +1,3 @@ module SQLite3 - VERSION = "2.0.0.dev" + VERSION = "2.0.0" end