Class: Cequel::Type::Counter

Inherits:
Base
  • Object
show all
Defined in:
lib/cequel/type.rb

Overview

Counter columns are a special type of column in Cassandra that can be incremented and decremented atomically. Counter columns cannot comingle with regular data columns in the same table. Unlike other columns, counter columns cannot be updated without Cassandra internally reading the existing state of the column

See Also:

Since:

  • 1.0.0

Instance Method Summary collapse

Methods inherited from Base

#cql_aliases, #cql_name, #internal_name, #to_s

Instance Method Details

#cast(value) ⇒ Object

Since:

  • 1.0.0


271
272
273
# File 'lib/cequel/type.rb', line 271

def cast(value)
  Integer(value)
end

#compatible_typesObject

Since:

  • 1.0.0


267
268
269
# File 'lib/cequel/type.rb', line 267

def compatible_types
  []
end

#internal_namesObject

Since:

  • 1.0.0


263
264
265
# File 'lib/cequel/type.rb', line 263

def internal_names
  ['org.apache.cassandra.db.marshal.CounterColumnType']
end