added another insert example to readme #72

merged 2 commits into from Oct 12, 2012


None yet

3 participants


a group of new programmers used this gem for a project today. We didn't realize that it supported the multi-insert syntax included here and a bunch of us ended up jumping through hoops and manually escaping characters ourselves. Added an example to README to make it clear this feature is supported.


@tenderlove tenderlove commented on an outdated diff Oct 12, 2012
@@ -33,6 +33,10 @@ Note that this module is only compatible with SQLite 3.6.16 or newer.
}.each do |pair|
db.execute "insert into numbers values ( ?, ? )", pair
+ # Execute multi-inserts
+ db.execute("INSERT INTO students (name, email, grade, blog)
+ VALUES (?, ?, ?, ?)", @name, @email, @grade, @blog)
tenderlove Oct 12, 2012 Sparkle Motion member

This is deprecated. It should be like this:

db.execute("INSERT INTO students (name, email, grade, blog)
                       VALUES (?, ?, ?, ?)", [@name, @email, @grade, @blog])
Sparkle Motion member

@ajonas04 what? @kcurtin opened this pull request less than 30min ago. o_O


i was using a very old version of sqlite3, and didn't even know. I updated the example with the changed syntax and changed the wording of the description :)

Sparkle Motion member

Awesome, thanks @kcurtin!

@tenderlove tenderlove merged commit 4bf746d into sparklemotion:master Oct 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment