class Cassie::Definition

A concrete implementation of a functional base class used to make CQL DDL or generic queries without any DSL. Inherit from this class to create application query classes.

See the {file:lib/cassie/statements/README.md} for information on usage and examples.

@example Inserting a record into a Table

class CreateKeyspaceQuery < Cassie::Definition
  attr_accessor :name

  self.prepare = false

  def statement
    cql = %(
      CREATE KEYSPACE #{name}
      WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}
      AND durable_writes = true;
     )
  end
end

CreateKeyspaceQuery.new(name: "my keyspace").excecute
#=> true