Sha256: f8d9966804add17857fe1c616665053992aa839f47baece86fe78f0f17b4f079

Contents?: true

Size: 1006 Bytes

Versions: 1

Compression:

Stored size: 1006 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    # Make sure we don't interfere with a pure Ruby version
    remove_const(:CassandraAdapter) if const_defined?(:CassandraAdapter)

    class CassandraAdapter < JdbcAdapter
      include ::ArJdbc::Cassandra

      def jdbc_connection_class(spec)
        ::ArJdbc::Cassandra.jdbc_connection_class
      end

      def jdbc_column_class
        CassandraColumn
      end
      #alias_chained_method :columns, :query_cache, :jdbc_columns

      # some QUOTING caching :

      @@quoted_table_names = {}

      def quote_table_name(name)
        unless quoted = @@quoted_table_names[name]
          quoted = super
          @@quoted_table_names[name] = quoted.freeze
        end
        quoted
      end

      @@quoted_column_names = {}

      def quote_column_name(name)
        unless quoted = @@quoted_column_names[name]
          quoted = super
          @@quoted_column_names[name] = quoted.freeze
        end
        quoted
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-jdbccassandra-adapter-0.0.1 lib/arjdbc/cassandra/adapter.rb