aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/db_drop.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-05-18 08:53:33 -0400
committerRalph Amissah <ralph@amissah.com>2014-05-18 08:53:36 -0400
commit7bfd567154b9fd468e5df53901c3d8c383cc25f8 (patch)
tree9967a2bc8fa8880193285f2dd52d77186bdb072d /lib/sisu/v5/db_drop.rb
parentv5 v6: db, use symbols to identify sql engine (diff)
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
Diffstat (limited to 'lib/sisu/v5/db_drop.rb')
-rw-r--r--lib/sisu/v5/db_drop.rb30
1 files changed, 24 insertions, 6 deletions
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