Sha256: cf0ebe3e21f7f003bb36d43a3bc26806af52761600b22ee0756516abce7cc69b
Contents?: true
Size: 837 Bytes
Versions: 3
Compression:
Stored size: 837 Bytes
Contents
require 'sequel' module SandthornDriverSequel class SequelDriver def initialize args = {} @url = args.fetch(:url) Sequel.default_timezone = :utc @db = Sequel.connect(@url) end def execute &block return block.call @db end def execute_in_transaction &block @db.transaction {|tr| return block.call @db } end end end # 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
3 entries across 3 versions & 1 rubygems