Class: Cassie::Query

Inherits:
Object show all
Extended by:
Connection::ClassMethods, Statements::Core::ClassMethods, Statements::Query::ClassMethods
Includes:
Connection, Statements::Core, Statements::Query
Defined in:
lib/cassie/query.rb

Overview

A concrete implementation of a functional base class used to make CQL SELECT queries. Inherit from this class to create application query classes.

See the README for information on usage and examples.

Examples:

Selecting a record from a Table

class UsersByUsernameQuery < Cassie::Query

  select_from :users_by_username

  where :username, :eq

  def build_result(row)
    User.new(row)
  end
end

user = UsersByUsernameQuery.new(username: 'eprothro').fetch_first
#=> #<User:0x007fedec219cd8 @id=123, @username="eprothro">

Direct Known Subclasses

FakeQuery, Schema::SelectVersionsQuery

Instance Attribute Summary

Attributes included from Statements::Execution::ClassMethods

#result_class

Attributes included from Statements::Statement

#cql, #params

Method Summary

Methods included from Connection::ClassMethods

keyspace, keyspace=

Methods included from Statements::Core

#initialize

Methods included from Statements::Execution::ClassMethods

#inherited

Methods included from Statements::Execution

#execute, #execute!, #execution_options

Methods included from Statements::Execution::Instrumentation

#execute

Methods included from Statements::Execution::PartitionLinking

#build_partition_linker, #execute, #partition_linker?

Methods included from Statements::Execution::Callbacks

#execute

Methods included from Statements::Execution::Consistency

#consistency

Methods included from Statements::Statement

#logger, #statement, #table, #to_cql

Methods included from Statements::Statement::Preparation::ClassMethods

#prepare, #prepare=, #prepare?

Methods included from Statements::Statement::Idempotency::ClassMethods

#idempotent, #idempotent=, #idempotent?, #non_idempotent

Methods included from Statements::Statement::Idempotency

#idempotent, #idempotent?

Methods included from Statements::Statement::TypeHinting::ClassMethods

#type_hints, #type_hints=

Methods included from Statements::Statement::TypeHinting

#type_hints

Methods included from Statements::Statement::Preparation

cache, init_cache, #statement

Methods included from Connection

#keyspace, #session