# File lib/arel/engines/sql/relations/table.rb, line 17
    def initialize(name, options = {})
      @name = name.to_s
      @table_exists = nil
      @table_alias = nil
      @christener = Sql::Christener.new
      @attributes = nil
      @matching_attributes = nil

      if options.is_a?(Hash)
        @options = options
        @engine = options[:engine] || Table.engine

        if options[:as]
          as = options[:as].to_s
          @table_alias = as unless as == @name
        end
      else
        @engine = options # Table.new('foo', engine)
      end

      if @engine.connection
        begin
          require "arel/engines/sql/compilers/#{@engine.adapter_name.downcase}_compiler"
        rescue LoadError
          begin
            # try to load an externally defined compiler, in case this adapter has defined the compiler on its own.
            require "#{@engine.adapter_name.downcase}/arel_compiler"
          rescue LoadError
            raise "#{@engine.adapter_name} is not supported by Arel."
          end
        end

        @@tables ||= engine.connection.tables
      end
    end