sqlite3-ruby failing on 1.9.2 ?

R

Rahul Kumar

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

Eito Katagiri

Hi,

If I issue as simple statement such as:

=A0 db.execute(" insert into basic ( =A0id, 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 ( =A0id, 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.
 
R

Rahul Kumar

Eito said:
Hi,

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.
 
R

Rahul Kumar

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.
 
L

Luis Lavena

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top