Sha256: 07e7e001b1c0c9b43932996d1c71a8eef9af94c7bdc1e43c52ffd3bb8e9d03d8

Contents?: true

Size: 646 Bytes

Versions: 2

Compression:

Stored size: 646 Bytes

Contents

module DirectiveRecord
  module Query
    class MySQL < SQL

    private

      def path_delimiter
        "."
      end

      def aggregate_delimiter
        ":"
      end

      def group_by_all_sql
        "NULL"
      end

      def quote_alias(sql_alias)
        "`#{sql_alias}`"
      end

      def finalize_options!(options)
        return unless options[:numerize_aliases]
        [:group_by, :having, :order_by].each do |key|
          if sql = options[key]
            options[:aliases].each do |pattern, replacement|
              sql.gsub! pattern, replacement
            end
          end
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
directiverecord-0.1.1 lib/directive_record/query/mysql.rb
directiverecord-0.1.0 lib/directive_record/query/mysql.rb