Posted By

almazom on 02/19/10


Tagged

db rails fast sqlite3


Versions (?)

Rails fast sqlite3 data filling


 / Published in: Rails
 

  1. sql = ActiveRecord::Base.connection();
  2. sql.execute("PRAGMA synchronous = OFF")
  3. sql.execute("BEGIN")
  4.  
  5. sqlrequest = "INSERT INTO `products` VALUES(null,'"+title+"','"+cat1+"','"+cat2+"','"+ye+"','"+price+"');"
  6. sql.execute(sqlrequest)
  7.  
  8. sql.execute("COMMIT")
  9. sql.execute("PRAGMA synchronous = NORMAL")

Report this snippet  

You need to login to post a comment.