From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.0.0.0/16 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 227EB1F576 for ; Tue, 30 Jan 2018 09:17:34 +0000 (UTC) Received: from localhost ([::1]:51724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egS2n-0002o7-DJ for e@80x24.org; Tue, 30 Jan 2018 04:17:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egS2j-0002m7-2z for dtas-all@nongnu.org; Tue, 30 Jan 2018 04:17:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egS2Z-0003P8-Bd for dtas-all@nongnu.org; Tue, 30 Jan 2018 04:17:29 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:59072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1egS2Z-0003OX-4z for dtas-all@nongnu.org; Tue, 30 Jan 2018 04:17:19 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0FCDC1FAE2 for ; Tue, 30 Jan 2018 09:17:14 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH 1/4] mlib: compatibility with Sequel 5.x Date: Tue, 30 Jan 2018 09:17:09 +0000 Message-Id: <20180130091712.21755-2-e@80x24.org> In-Reply-To: <20180130091712.21755-1-e@80x24.org> References: <20180130091712.21755-1-e@80x24.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.71.152.64 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" Apparently some degree of thread-safety is being enforced; not sure I agree, but oh well... --- lib/dtas/mlib.rb | 15 ++++++--------- test/test_mlib.rb | 4 ++-- 2 files changed, 8 insertions(+), 11 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 diff --git a/test/test_mlib.rb b/test/test_mlib.rb index a5c446f..0241314 100644 --- a/test/test_mlib.rb +++ b/test/test_mlib.rb @@ -4,7 +4,7 @@ require_relative 'helper' begin require 'dtas/mlib' - require 'sequel/no_core_ext' + require 'sequel' require 'sqlite3' rescue LoadError => err warn "skipping mlib test: #{err.message}" @@ -13,7 +13,7 @@ class TestMlib < Testcase def setup - @db = Sequel.sqlite(':memory:') + @db = Sequel.sqlite(':memory:', case_sensitive_like: false) end def test_migrate -- EW