sync up with sequel adapter from my Sequel fork until it's officially merged in

This commit is contained in:
Brian Lopez 2010-08-05 22:53:36 -07:00
parent ad34357e57
commit f4fb9e8034
1 changed files with 4 additions and 1 deletions

View File

@ -119,8 +119,11 @@ module Sequel
# option is :select, yield the result of the query, otherwise
# yield the connection if a block is given.
def _execute(conn, sql, opts)
query_opts = {:symbolize_keys => true}
query_opts.merge!(:database_timezone => Sequel.database_timezone) if Sequel.respond_to?(:database_timezone)
query_opts.merge!(:application_timezone => Sequel.application_timezone) if Sequel.respond_to?(:application_timezone)
begin
r = log_yield(sql){conn.query(sql, :symbolize_keys => true)}
r = log_yield(sql){conn.query(sql, query_opts)}
if opts[:type] == :select
yield r if r
elsif block_given?