Raise ArgumentError if Database#execute, #execute_batch, or #query are passed multiple bind parameters that are not in an Array. In v2.0.0 these methods would silently swallow additional arguments, and this change makes the failure explicit. See the CHANGELOG notes for v2.0.0 for examples on how to update your code. [#527] @flavorjones
Fixed a regression in v2.0.0 that caused Database#execute_batch to raise an encoding exception when passed some non-ascii strings. As a result of this fix, Database#prepare now ensures the "remainder" string will always be encoded as UTF-8. [#524] @flavorjones
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.
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
Support the SUPER_JOURNAL flag which is an alias for MASTER_JOURNAL as of sqlite 3.33.0. [#467] @flavorjones
Statement#stat and Statement#memused introduced to report statistics. [#461] @fractaledmind
Statement#sql and Statement#expanded_sql introduced to retrieve the SQL statement associated with the Statement object. [#293, #498] @tenderlove
SQLite3.status introduced to return run-time status and reset high-water marks. See SQLite3::Constants::Status for details. [#520] @wjlroe
Improved
Avoid leaking memory for statements that are not closed properly. [#392] @haileys
Fix encoding for values passed to custom functions. [#218, #488] @tenderlove
Changed
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
Freeze results that come from the database. [#480] @tenderlove
The encoding of a Database is no longer cached. [#485] @tenderlove
Database#transaction returns the result of the block when used with a block. [#508] @alexcwatt
Database#execute_batch returns the result of the last statement executed. [#512] @alexcwatt
Removed
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:
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");EOSQLclassMyTranslator < DelegateClass(SQLite3::Statement)defsteprow=superreturnifdone?row.map.with_indexdo |item,i|
casetypes[i]when"integer"# turn all integers to floatsitem.to_fwhen"string"# add "hello" to all stringsitem + "hello"endendendenddb.prepare("SELECT * FROM items")do |stmt|
stmt=MyTranslator.new(stmt)whilerow=stmt.stepprowendend
Removed types and fields readers on row objects, which have been deprecated since
v1.3.6. [#471] @tenderlove
Deprecated code looks like this:
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:
@db.prepare("select * from foo")do |v|
assert_equal["blob"],v.typesend
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:
@db.query("select * from foo where a = ? and b = ? and c = ?",1,2,3)
For these cases, pass the bind parameters as an array:
@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
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu cancel merge
Cancels automatic merging of this PR
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ sqlite3 (1.7.3 → 2.0.1) · Repo · Changelog
Release Notes
2.0.1
2.0.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands