diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-05-18 08:53:33 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-05-18 08:53:36 -0400 |
commit | 7bfd567154b9fd468e5df53901c3d8c383cc25f8 (patch) | |
tree | 9967a2bc8fa8880193285f2dd52d77186bdb072d /lib/sisu/v5/db_remove.rb | |
parent | v5 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_remove.rb')
-rw-r--r-- | lib/sisu/v5/db_remove.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/sisu/v5/db_remove.rb b/lib/sisu/v5/db_remove.rb index 9a7ea8ea..2dea65f2 100644 --- a/lib/sisu/v5/db_remove.rb +++ b/lib/sisu/v5/db_remove.rb @@ -90,8 +90,8 @@ module SiSU_DbRemove WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns - x=@conn.select_one(remove_selected) - x ? (x.join.to_i) : nil + x=@conn.exec(remove_selected) + x.field_values("tid")[0] end if del_id sql_entry=[ @@ -105,12 +105,20 @@ module SiSU_DbRemove if driver_sqlite3 @conn.transaction sql_entry.each do |s| - @conn.execute(s) + begin + @conn.execute(s) + rescue + next + end end @conn.commit if driver_sqlite3 else sql_entry.each do |s| - @conn.execute(s) + begin + @conn.exec_params(s) + rescue + next + end end end if @opt.act[:maintenance][:set]==:on |