Sha256: dd924c87d6279edb35f51c9d9d916048cd9792f11477d582b2b19b12aa66d1a3

Contents?: true

Size: 535 Bytes

Versions: 7

Compression:

Stored size: 535 Bytes

Contents

require 'cassandra-cql'

module Auger
  
  class Project
    def cql(port = 9160, &block)
      @connections << Cql.load(port, &block)
    end
  end

  class Cql < Auger::Connection
    def open(host, options)
      CassandraCQL::Database.new "#{host}:#{options[:port]}", options
    end

    def close(db)
      db.disconnect!
    end

    def execute(statement, &block)
      @requests << CqlRequest.load(statement, &block)
    end
  end

  class CqlRequest < Auger::Request
    def run(db)
      db.execute(@arg)
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
auger-1.3.2 lib/plugins/cql.rb
auger-1.3.1 lib/plugins/cql.rb
auger-1.3.0 lib/plugins/cql.rb
auger-1.2.4 lib/plugins/cql.rb
auger-1.2.3 lib/plugins/cql.rb
auger-1.2.2 lib/plugins/cql.rb
auger-1.2.0 lib/plugins/cql.rb