sqlite3-ruby Changelog

2.5.0.rc1 / 2024-12-14

Ruby

This release introduces native gem packages that include Ruby 3.4.

2.4.1 / 2024-12-08

Dependencies

The description from the upstream maintainers is:

> SQLite version 3.47.2, now available, fixes an important bug that first appeared in the 3.47.0 > release. In SQLite versions 3.47.0 and 3.47.1, if you try to convert a string into a > floating-point value and the first 16 significant digits of the value are exactly > “1844674407370955”, then the floating-point number generated might be incorrect. The problem > only affects x64 and i386 CPUs, so it does not affect you if you are running on ARM. And it only > affects releases 3.47.0 and 3.47.1. If you are running SQLite versions 3.47.0 or 3.47.1, then > upgrading is recommended.

Saving you a click, you should upgrade if you’re running sqlite3-ruby v2.1.1 or later.

Fixed

2.4.0 / 2024-12-03

Added

2.3.1 / 2024-11-25

Dependencies

2.3.0 / 2024-11-20

Added

Fixed

2.2.0 / 2024-10-30

Added

Improved

2.1.1 / 2024-10-22

Dependencies

2.1.0 / 2024-09-24

Ruby

Fork safety improvements

Sqlite itself is {not fork-safe}[https://www.sqlite.org/howtocorrupt.html#carrying_an_open_database_connection_across_a_fork]. Specifically, writing in a child process to a database connection that was created in the parent process may corrupt the database file. To mitigate this risk, sqlite3-ruby has implemented the following changes:

If it’s at all possible, we strongly recommend that you close writable database connections in the parent before forking. If absolutely necessary (and you know what you’re doing), you may suppress the fork safety warnings by calling SQLite3::ForkSafety.suppress_warnings!.

See the README’s “Fork Safety” section and adr/2024-09-fork-safety.md for more information. [#558, #565, #566] @flavorjones

Improved

Documentation

2.0.4 / 2024-08-13

Dependencies

2.0.3 / 2024-07-29

Improved

2.0.2 / 2024-05-23

Dependencies

2.0.1 / 2024-04-20

Fixed

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.

Ruby

Packaging

Native (precompiled) gems are now available for Linux Musl. [#442] @flavorjones

Here are the platforms for which native gems are shipped:

⚠ 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 github.com/rubygems/rubygems/issues/7432

See the INSTALLATION doc for more information.

Dependencies

Added

Improved

Changed

Removed

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

db.prepare(“SELECT * FROM items”) do |stmt| stmt = MyTranslator.new(stmt) while row = stmt.step p row end end “‘

Deprecated code looks like this:

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

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])

1.7.3 / 2024-03-15

Dependencies

1.7.2 / 2024-01-30

Dependencies

1.7.1 / 2024-01-24

Dependencies

1.7.0 / 2023-12-27

Ruby

This release introduces native gem support for Ruby 3.3.

This release ends native gem support for Ruby 2.7, for which upstream support ended 2023-03-31. Ruby 2.7 is still generally supported, but will not be shipped in the native gems.

This release ends support for Ruby 1.9.3, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, and 2.6.

Improved

1.6.9 / 2023-11-26

Dependencies

Added

1.6.8 / 2023-11-01

Dependencies

Added

1.6.7 / 2023-10-10

Dependencies

Vendored sqlite is updated to v3.43.2.

Upstream release notes:

Added

1.6.6 / 2023-09-12

Dependencies

Vendored sqlite is updated to v3.43.1.

Upstream release notes:

1.6.5 / 2023-09-08

Packaging

1.6.4 / 2023-08-26

Dependencies

Vendored sqlite is updated to v3.43.0.

Upstream release notes:

SQLite Release 3.43.0 On 2023-08-24 * Add support for Contentless-Delete FTS5 Indexes. This is a variety of FTS5 full-text search index that omits storing the content that is being indexed while also allowing records to be deleted. * Enhancements to the date and time functions: * Added new time shift modifiers of the form ±YYYY-MM-DD HH:MM:SS.SSS. * Added the timediff() SQL function. * Added the octet_length(X) SQL function. * Added the sqlite3_stmt_explain() API. * Query planner enhancements: * Generalize the LEFT JOIN strength reduction optimization so that it works for RIGHT and FULL JOINs as well. Rename it to OUTER JOIN strength reduction. * Enhance the theorem prover in the OUTER JOIN strength reduction optimization so that it returns fewer false-negatives. * Enhancements to the decimal extension: * New function decimal_pow2(N) returns the N-th power of 2 for integer N between -20000 and +20000. * New function decimal_exp(X) works like decimal(X) except that it returns the result in exponential notation - with a “e+NN” at the end. * If X is a floating-point value, then the decimal(X) function now does a full expansion of that value into its exact decimal equivalent. * Performance enhancements to JSON processing results in a 2x performance improvement for some kinds of processing on large JSON strings. * New makefile target “verify-source” checks to ensure that there are no unintentional changes in the source tree. (Works for canonical source code only - not for precompiled amalgamation tarballs.) * Added the SQLITE_USE_SEH compile-time option that enables Structured Exception Handling on Windows while working with the memory-mapped shm file that is part of WAL mode processing. This option is enabled by default when building on Windows using Makefile.msc. * The VFS for unix now assumes that the nanosleep() system call is available unless compiled with -DHAVE_NANOSLEEP=0.

1.6.3 / 2023-05-16

Dependencies

Vendored sqlite is updated to v3.42.0.

From the release announcement:

This is a regular enhancement release. The main new features are: * SQLite will now parse and understand JSON5, though it is careful to generate only pure, canonical JSON. * The secure-delete option has been added to the FTS5 extension.

1.6.2 / 2023-03-27

Dependencies

Vendored sqlite is updated from v3.41.0 to v3.41.2.

Packaging

1.6.1 / 2023-02-22

Dependencies

1.6.0 / 2023-01-13

Ruby

This release introduces native gem support for Ruby 3.2.

This release ends native gem support for Ruby 2.6, for which upstream support ended 2022-04-12.

Dependencies

Fixes

1.5.4 / 2022-11-18

Dependencies

1.5.3 / 2022-10-11

Fixed

1.5.2 / 2022-10-01

Packaging

This version correctly vendors the tarball for sqlite v3.39.4 in the vanilla “ruby” platform gem package, so that users will not require network access at installation.

v1.5.0 and v1.5.1 mistakenly packaged the tarball for sqlite v3.38.5 in the vanilla “ruby” platform gem, resulting in downloading the intended tarball over the network at installation time (or, if the network was not available, failure to install). Note that the precompiled native gems were not affected by this issue. [#352]

1.5.1 / 2022-09-29

Dependencies

Security

The vendored version of sqlite, v3.39.4, should be considered to be a security release. From the release notes:

Version 3.39.4 is a minimal patch against the prior release that addresses issues found since the prior release. In particular, a potential vulnerability in the FTS3 extension has been fixed, so this should be considered a security update.

In order to exploit the vulnerability, an attacker must have full SQL access and must be able to construct a corrupt database with over 2GB of FTS3 content. The problem arises from a 32-bit signed integer overflow.

For more information please see GHSA-mgvv-5mxp-xq67.

1.5.0 / 2022-09-08

Packaging

Faster, more reliable installation

Native (precompiled) gems are available for Ruby 2.6, 2.7, 3.0, and 3.1 on all these platforms:

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.

See the README for more information.

More consistent developer experience

Both the native (precompiled) gems and the vanilla “ruby platform” (source) gem include sqlite v3.39.3 by default.

Defaulting to a consistent version of sqlite across all systems means that your development environment behaves exactly like your production environment, and you have access to the latest and greatest features of sqlite.

You can opt-out of the packaged version of sqlite (and use your system-installed library as in versions < 1.5.0). See the README for more information.

Release notes for this version of sqlite

Rubies and Platforms

Added

Fixed

1.4.4 / 2022-06-14

Fixes

1.4.3 / 2022-05-25

Enhancements

1.4.2 / 2019-12-18

1.4.1

1.4.0

Enhancements

Bugfixes

1.3.13

Enhancements

1.3.12

Bugfixes

1.3.11 / 2015-10-10

Enhancements

Internal

1.3.10 / 2014-10-30

Enhancements

1.3.9 / 2014-02-25

Bugfixes

1.3.8 / 2013-08-17

Enhancements

Bugfixes

Internal

1.3.7 / 2013-01-11

Bugfixes

Internal

1.3.6 / 2012-04-16

Enhancements

Bugfixes

Deprecations

1.3.5 / 2011-12-03 - ZOMG Holidays are here Edition!

Enhancements

Bugfixes

Internal

1.3.4 / 2011-07-25

Enhancements

Bugfixes

1.3.3 / 2010-01-16

Bugfixes

1.3.2 / 2010-10-30 / RubyConf Uruguay Edition!

Enhancements

Bugfixes

Deprecations

1.3.1 / 2010-07-09

Enhancements

Bugfixes

1.3.0 / 2010-06-06

Enhancements

Experimental

Bugfixes

1.3.0.beta.2 / 2010-05-15

Enhancements

Bugfixes

1.3.0.beta.1 / 2010-05-10

Enhancements

Experimental

Bugfixes

1.2.5 / 2009-07-25

1.2.4.1 (internal) / 2009-07-05

1.2.4 / 2008-08-27

1.2.3 / 2008-08-26

1.2.2 / 2008-05-31