about summary refs log tree commit homepage
path: root/lib/dtas
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-01-29 01:43:05 +0000
committerEric Wong <e@80x24.org>2018-01-29 01:43:05 +0000
commit3686c523b0122ee979696e7d4ce8c03155248d7e (patch)
treecbad275ff068fda8ac74dfe2bc0c04895182c143 /lib/dtas
parent742d2337e5afdedb5489e4b9f965e5d34c6db49e (diff)
downloaddtas-3686c523b0122ee979696e7d4ce8c03155248d7e.tar.gz
Apparently some degree of thread-safety is being enforced;
not sure I agree, but oh well...
Diffstat (limited to 'lib/dtas')
-rw-r--r--lib/dtas/mlib.rb15
1 files changed, 6 insertions, 9 deletions
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