added another insert example to readme #72

Merged
merged 2 commits into from Oct 12, 2012

Projects

None yet

3 participants

@kcurtin
kcurtin commented Oct 12, 2012

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.

Thanks!

@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
end
+
+ # Execute multi-inserts
+ db.execute("INSERT INTO students (name, email, grade, blog)
+ VALUES (?, ?, ?, ?)", @name, @email, @grade, @blog)
@tenderlove
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])
@tenderlove
Member

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

@adamjonas

Just supporting his pull request that's all. I love the gem. Thanks for all
your hard work...

Best,
Adam
On Oct 11, 2012 10:50 PM, "Aaron Patterson" notifications@github.com
wrote:

@ajonas04 https://github.com/ajonas04 what? @kcurtinhttps://github.com/kcurtinopened this pull request less than 30min ago. o_O


Reply to this email directly or view it on GitHubhttps://github.com/luislavena/sqlite3-ruby/pull/72#issuecomment-9365141.

@kcurtin
kcurtin commented Oct 12, 2012

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

@tenderlove
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