Sha256: 76620a3e88c130f5dcc1b89ee445616ccc7b8618abe6994b14f164064dbda5a3

Contents?: true

Size: 1.59 KB

Versions: 5

Compression:

Stored size: 1.59 KB

Contents

# frozen-string-literal: true

Sequel::Deprecation.deprecate("Sequel support for Informix", "Please consider maintaining it yourself as an external sequel adapter if you want to continue using it")

module Sequel
  module Informix
    Sequel::Database.set_shared_adapter_scheme(:informix, self)

    module DatabaseMethods
      TEMPORARY = 'TEMP '.freeze
      Sequel::Deprecation.deprecate_constant(self, :TEMPORARY)

      # Informix uses the :informix database type
      def database_type
        :informix
      end

      private

      # Informix has issues with quoted identifiers, so
      # turn off database quoting by default.
      def quote_identifiers_default
        false
      end

      # SQL fragment for showing a table is temporary
      def temporary_table_sql
        'TEMP '
      end
    end
    
    module DatasetMethods
      FIRST = " FIRST ".freeze
      Sequel::Deprecation.deprecate_constant(self, :FIRST)
      SKIP = " SKIP ".freeze
      Sequel::Deprecation.deprecate_constant(self, :SKIP)

      Dataset.def_sql_method(self, :select, %w'select limit distinct columns from join where having group compounds order')

      def quote_identifiers?
        @opts.fetch(:quote_identifiers, false)
      end

      # Informix does not support INTERSECT or EXCEPT
      def supports_intersect_except?
        false
      end

      private

      def select_limit_sql(sql)
        if o = @opts[:offset]
          sql << " SKIP "
          literal_append(sql, o)
        end
        if l = @opts[:limit]
          sql << " FIRST "
          literal_append(sql, l)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
sequel-4.49.0 lib/sequel/adapters/shared/informix.rb
sequel-4.48.0 lib/sequel/adapters/shared/informix.rb
tdiary-5.0.5 vendor/bundle/gems/sequel-4.47.0/lib/sequel/adapters/shared/informix.rb
sequel-4.47.0 lib/sequel/adapters/shared/informix.rb
sequel-4.46.0 lib/sequel/adapters/shared/informix.rb