Skip to content

Why doesn't "update ... where column = ?" take all of a sudden? #525

@forthrin

Description

@forthrin
require 'sqlite3'

db = SQLite3::Database.open("#{Dir.home}/foo.db")
db.results_as_hash = true
db.query('drop table if exists foo')
db.query('create table foo (key, value)')
db.query('insert into foo values (1, ?)', 'NO')
db.query('update foo set value = ? where key = 1', 'MAYBE')
db.query('update foo set value = ? where key = ?', 'YES', 1)
pp db.query('select * from foo').to_a
[{"key"=>1, "value"=>"MAYBE"}]
$ ruby --version
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
$ gem info sqlite3
sqlite3 (2.0.0, 1.7.3)
$ sqlite3 --version
3.43.2 2023-10-10 13:08:14 1b37c146ee9ebb7acd0160c0ab1fd11017a419fa8a3187386ed8cb32b709aapl (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions