lua-cassandra

This library is a pure Lua implementation of the Cassandra CQL binary protocol. It is a fork of jbochi/lua-resty-cassandra with support for more features, a few bug fixes and a more complete documentation.

Among the features it adds, this fork supports both binary protocols v2 and v3.

The following table describes which version(s) of the binary protocol is supported for each version of Cassandra:


Cassandra VersionBinary Protocol support
1.21
2.01, 2
2.11, 2, 3
2.21, 2, 3


Since lua-cassandra supports binary protocol v2 and v3, it only supports Cassandra 2.0 and later.

Installation

Luarocks

Installation through luarocks is recommended:

$ luarocks install lua-cassandra

Manual

Simply copy the src/ folder in your application.

Usage

  • To use the binary protocol v3 (Cassandra 2.1 and later):
local cassandra = require "cassandra"
  • To use the binary protocol v2 (Legacy support for Cassandra 2.0):
local cassandra = require "cassandra.v2"

See the cassandra module for a detailed list of available functions.

Once you have an instance of cassandra, use it to create sessions. See the session module for a detailed list of functions.

Finally, check the examples section for concrete examples of basic or advanced usage.

generated by LDoc 1.4.3 Last updated 2015-07-30 16:28:43