Sha256: 6d0396dc990496b9878fe1d85073d1799ba47347bef6a419f68ad42c5083833e

Contents?: true

Size: 734 Bytes

Versions: 1

Compression:

Stored size: 734 Bytes

Contents

module Blazer
  module Adapters
    class BaseAdapter
      attr_reader :data_source

      def initialize(data_source)
        @data_source = data_source
      end

      def run_statement(statement, comment)
        # the one required method
      end

      def tables
        [] # optional, but nice to have
      end

      def schema
        [] # optional, but nice to have
      end

      def preview_statement
        "" # also optional, but nice to have
      end

      def reconnect
        # optional
      end

      def cost(statement)
        # optional
      end

      def explain(statement)
        # optional
      end

      protected

      def settings
        @data_source.settings
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blazer-1.6.2 lib/blazer/adapters/base_adapter.rb