From 7bfd567154b9fd468e5df53901c3d8c383cc25f8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 18 May 2014 08:53:33 -0400 Subject: v5 v6: db, remove ruby-dbi, for: pg ruby-pg, sqlite ruby-sqlite3 (already uses) * ruby-pg require for postgresql * ruby-sqlite3 require for sqlite3 (done previously: already using ruby-sqlite3 rather than ruby-dbi) * ruby-dbi remove calls (in any common files & sisu pg and sisu sqlite3) * separate pg and sqlite db actions --- lib/sisu/v5/db_drop.rb | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v5/db_drop.rb') diff --git a/lib/sisu/v5/db_drop.rb b/lib/sisu/v5/db_drop.rb index 1a76eff9..75e98faa 100644 --- a/lib/sisu/v5/db_drop.rb +++ b/lib/sisu/v5/db_drop.rb @@ -118,14 +118,24 @@ module SiSU_DbDrop else @conn.transaction @drop_table.each do |d| - @conn.execute(d) - end + begin + @conn.exec_params(d) + rescue + next + end + end @conn.commit end - else + when :pg + @conn.transaction @drop_table.each do |d| - @conn.execute(d) + begin + @conn.exec_params(d) + rescue + next + end end + @conn.commit end rescue case @sql_type @@ -135,7 +145,11 @@ module SiSU_DbDrop end else @drop_table.each do |d| - @conn.execute(d) + begin + @conn.exec_params(d) + rescue + next + end end end ensure @@ -145,7 +159,11 @@ module SiSU_DbDrop def conn_execute_array(sql_arr) @conn.transaction do |conn| sql_arr.each do |sql| - conn.execute(sql) + begin + conn.exec_params(sql) + rescue + next + end end end end -- cgit v1.2.3