Sqlite3-ruby failing on 1.9.2?

I have apps working on 1.9.1 but simple inserts are failing on 1.9.2.
Is there some change in versions required, I’ve got latest versions.

OS X 10.6
sqlite3 3.6.22
sqlite3-ruby 1.3.1

If I issue as simple statement such as:

db.execute(" insert into basic ( id, desc ) values (?,?)",10, desc )

The first column gets a nil, which obviously fails if that col has a
constraint.

However, if i do this it seems to work:

db.execute(" insert into basic ( id, desc ) values (10,?)",desc )

thanks,
rahul

(my 1.9.1 version is an earlier on 1.2.5)

Hi,

On Sat, Sep 11, 2010 at 10:43 PM, Rahul K. [email protected]
wrote:

If I issue as simple statement such as:

db.execute(" insert into basic ( id, desc ) values (?,?)",10, desc )

The first column gets a nil, which obviously fails if that col has a
constraint.

Try the statement below instead

db.execute(" insert into basic ( id, desc ) values (?,?)", [10, desc
])

(my 1.9.1 version is an earlier on 1.2.5)

Some APIs have been changed since version 1.3.0.
According to API_CHANGES.rdoc,

SQLite3::Database#execute only accepts an array for bind parameters.

Eito Katagiri wrote:

Hi,

On Sat, Sep 11, 2010 at 10:43 PM, Rahul K. [email protected]
wrote:

If I issue as simple statement such as:

� db.execute(" insert into basic ( �id, desc ) values (?,?)",10, desc )

The first column gets a nil, which obviously fails if that col has a
constraint.

Try the statement below instead

db.execute(" insert into basic ( �id, desc ) values (?,?)", [10, desc
])

(my 1.9.1 version is an earlier on 1.2.5)

Some APIs have been changed since version 1.3.0.
According to API_CHANGES.rdoc,

SQLite3::Database#execute only accepts an array for bind parameters.

  1. The samples for execute used to give “*bind_params”, but now they are
    working after i removed the “splat”.
    (Is this compatible with earlier ruby versions ?)

  2. bind_params() now has problems with Time and Date classes.
    I did a “to_s” to the values i am putting in the array, and they are
    working. I will only know later if the queries
    selecting data on time and date are working correctly.

  3. I checked API_CHANGES.rdoc and Changelog.rdoc but i can’t see the
    execute
    change, and any other changes that affect date and time.

I would be grateful if someone could point out where these changes are.
Has compatibility with earlier versions broken with these changes.

thanks alot for the quick reply.

Okay, one more issue in sqlite3-ruby 1.3.x
It seems to have stopped respecting “arrayfields”.

My retrieved rows are coming back as Arrays, causing my app to fail.

Any else facing this ?

thx.

On Sep 12, 4:45 am, Rahul K. [email protected] wrote:

Okay, one more issue in sqlite3-ruby 1.3.x
It seems to have stopped respecting “arrayfields”.

My retrieved rows are coming back as Arrays, causing my app to fail.

Any else facing this ?

sqlite3-ruby has introduced API changes in 1.3.x line compared to
1.2.x line.

That is due internal code changes and interface with the C library.

Please check code in the repository:

http://github.com/luislavena/sqlite3-ruby

For the complete list of changes.

Also, further questions you have about it, please raise them at
sqlite3-ruby group for better responses form active users.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs