Sha256: 31c760a28872b3602f46e89a5783e8a326b894f45241df05029ccc70f78917df

Contents?: true

Size: 430 Bytes

Versions: 4

Compression:

Stored size: 430 Bytes

Contents

require 'sequel'

module SandthornDriverSequel
  class SequelDriver
    def initialize args = {}
      @url = args.fetch(:url)
      Sequel.default_timezone = :utc
    end
    def execute &block
      Sequel.connect(@url) { |db| return block.call db}
    end
    def execute_in_transaction &block
      Sequel.connect(@url) do |db|
        db.transaction do
          return block.call db
        end
      end
    end 
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sandthorn_driver_sequel-1.0.3 lib/sandthorn_driver_sequel/sequel_driver.rb
sandthorn_driver_sequel-1.0.2 lib/sandthorn_driver_sequel/sequel_driver.rb
sandthorn_driver_sequel-1.0.1 lib/sandthorn_driver_sequel/sequel_driver.rb
sandthorn_driver_sequel-1.0.0 lib/sandthorn_driver_sequel/sequel_driver.rb