From 3686c523b0122ee979696e7d4ce8c03155248d7e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Jan 2018 01:43:05 +0000 Subject: mlib: compatibility with Sequel 5.x Apparently some degree of thread-safety is being enforced; not sure I agree, but oh well... --- lib/dtas/mlib.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/dtas/mlib.rb') diff --git a/lib/dtas/mlib.rb b/lib/dtas/mlib.rb index 24393d5..e217b59 100644 --- a/lib/dtas/mlib.rb +++ b/lib/dtas/mlib.rb @@ -37,16 +37,13 @@ class DTAS::Mlib # :nodoc: def initialize(db) if String === db + require 'sequel' + opts = { single_threaded: true } db = "sqlite://#{db}" unless db.include?('://') - require 'sequel/no_core_ext' - db = Sequel.connect(db, single_threaded: true) - end - if db.class.to_s.downcase.include?('sqlite') - db.transaction_mode = :immediate - db.synchronous = :off - db.case_sensitive_like = false - else - warn 'non-SQLite databases may not work in the future' + opts[:transaction_mode] = :immediate + opts[:synchronous] = :off + opts[:case_sensitive_like] = false # only for 'search' + db = Sequel.connect(db, opts) end @db = db @pwd = nil -- cgit v1.2.3-24-ge0c7