Sha256: 96ec62976e9dfc984734772dbf0561eca256d65d732a53da23dfa19f8fcc1161

Contents?: true

Size: 761 Bytes

Versions: 2

Compression:

Stored size: 761 Bytes

Contents

require 'upsert/connection/jdbc'

class Upsert
  class Connection
    # @private
    class Java_ComMysqlJdbc_JDBC4Connection < Connection
      include Jdbc

      def quote_ident(k)
        if metal.useAnsiQuotedIdentifiers
          DOUBLE_QUOTE + k.to_s.gsub(DOUBLE_QUOTE, '""') + DOUBLE_QUOTE
        else
          # Escape backticks by doubling them.  Ref http://dev.mysql.com/doc/refman/5.7/en/identifiers.html
          BACKTICK + k.to_s.gsub(BACKTICK, BACKTICK + BACKTICK) + BACKTICK
        end
      end

      def bind_value(v)
        case v
        when Time, DateTime
          # mysql doesn't like it when you send timezone to a datetime
          Upsert.utc_iso8601 v, false
        else
          super
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upsert-2.2.1 lib/upsert/connection/Java_ComMysqlJdbc_JDBC4Connection.rb
upsert-2.2.0 lib/upsert/connection/Java_ComMysqlJdbc_JDBC4Connection.rb