diff options
Diffstat (limited to 'lib/sisu/v5/db_remove.rb')
-rw-r--r-- | lib/sisu/v5/db_remove.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/sisu/v5/db_remove.rb b/lib/sisu/v5/db_remove.rb index 9ffba024..2dea65f2 100644 --- a/lib/sisu/v5/db_remove.rb +++ b/lib/sisu/v5/db_remove.rb @@ -70,7 +70,7 @@ module SiSU_DbRemove @db=SiSU_Env::InfoDb.new end def remove - driver_sqlite3=if @sql_type=='sqlite' + driver_sqlite3=if @sql_type==:sqlite (@conn.inspect.match(/^(.{10})/)[1]==@db.sqlite.conn_sqlite3.inspect.match(/^(.{10})/)[1]) \ ? true : false @@ -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 |