Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. require_relative '../db/connection'
  2.  
  3. def temp_table
  4. ActiveRecord::Base.connection.execute('BEGIN;')
  5. ActiveRecord::Base.connection.execute('CREATE TABLE list_words ( id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, name TEXT);')
  6. ActiveRecord::Base.connection.execute('INSERT INTO list_words (name) values ("Pera"),("Manzana"),("Naranja");')
  7. ActiveRecord::Base.connection.execute('SELECT * FROM list_words;')
  8. ActiveRecord::Base.connection.execute('ROLLBACK;')
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement