diff --git a/.ci/busted_print.lua b/.ci/busted_print.lua
new file mode 100644
index 0000000..ecc9493
--- /dev/null
+++ b/.ci/busted_print.lua
@@ -0,0 +1,21 @@
+local ansicolors = require 'ansicolors'
+
+return function(options)
+ local handler = require 'busted.outputHandlers.utfTerminal'(options)
+
+ handler.fileStart = function(file)
+ io.write('\n' .. ansicolors('%{cyan}' .. file.name) .. ':')
+ end
+
+ handler.testStart = function(element, parent, status, debug)
+ io.write('\n ' .. handler.getFullName(element) .. ' ... ')
+ io.flush()
+ end
+
+ local busted = require 'busted'
+
+ busted.subscribe({ 'file', 'start' }, handler.fileStart)
+ busted.subscribe({ 'test', 'start' }, handler.testStart)
+
+ return handler
+end
diff --git a/.travis/platform.sh b/.ci/platform.sh
similarity index 100%
rename from .travis/platform.sh
rename to .ci/platform.sh
diff --git a/.ci/run_tests.sh b/.ci/run_tests.sh
new file mode 100755
index 0000000..012db0d
--- /dev/null
+++ b/.ci/run_tests.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+if [ "$OPENRESTY_TESTS" != "yes" ]; then
+ busted -v --coverage -o .ci/busted_print.lua
+ make lint
+ luacov-coveralls -i cassandra
+else
+ prove -l t
+fi
diff --git a/.ci/setup_cassandra.sh b/.ci/setup_cassandra.sh
new file mode 100755
index 0000000..afa2177
--- /dev/null
+++ b/.ci/setup_cassandra.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+arr=(${HOSTS//,/ })
+
+pip install --user PyYAML six
+git clone https://github.com/pcmanus/ccm.git
+pushd ccm
+./setup.py install --user
+popd
+ccm create test -v binary:$CASSANDRA_VERSION -n ${#arr[@]} -d
+ccm start -v
+ccm status
diff --git a/.ci/setup_lua.sh b/.ci/setup_lua.sh
new file mode 100755
index 0000000..ed671de
--- /dev/null
+++ b/.ci/setup_lua.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+# A script for setting up environment for travis-ci testing.
+# Sets up Lua and Luarocks.
+# LUA must be "lua5.1", "lua5.2" or "luajit".
+# luajit2.0 - master v2.0
+# luajit2.1 - master v2.1
+
+LUAJIT="no"
+
+source .ci/platform.sh
+
+############
+# Lua/LuaJIT
+############
+
+if [ "$LUA" == "luajit" ]; then
+ LUAJIT="yes"
+ LUA="luajit-2.0"
+elif [ "$LUA" == "luajit-2.0" ]; then
+ LUAJIT="yes"
+elif [ "$LUA" == "luajit-2.1" ]; then
+ LUAJIT="yes"
+fi
+
+if [ "$LUAJIT" == "yes" ]; then
+ mkdir -p $LUAJIT_DIR
+
+ # If cache is empty, download and compile
+ if [ ! "$(ls -A $LUAJIT_DIR)" ]; then
+ git clone http://luajit.org/git/luajit-2.0.git
+ pushd luajit-2.0
+
+ if [ "$LUA" == "luajit-2.0" ]; then
+ git checkout v2.0.4
+ elif [ "$LUA" == "luajit-2.1" ]; then
+ git checkout v2.1
+ fi
+
+ make
+ make install PREFIX=$LUAJIT_DIR
+ popd
+
+ if [ "$LUA" == "luajit-2.1" ]; then
+ ln -sf $LUAJIT_DIR/bin/luajit-2.1.0-beta1 $LUAJIT_DIR/bin/luajit
+ fi
+
+ ln -sf $LUAJIT_DIR/bin/luajit $LUAJIT_DIR/bin/lua
+ fi
+
+ LUA_INCLUDE="$LUAJIT_DIR/include/$LUA"
+else
+ if [ "$LUA" == "lua5.1" ]; then
+ curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
+ pushd lua-5.1.5
+ elif [ "$LUA" == "lua5.2" ]; then
+ curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
+ pushd lua-5.2.3
+ elif [ "$LUA" == "lua5.3" ]; then
+ curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz
+ pushd lua-5.3.0
+ fi
+
+ make $PLATFORM
+ make install INSTALL_TOP=$LUA_DIR
+ popd
+
+ LUA_INCLUDE="$LUA_DIR/include"
+fi
+
+##########
+# Luarocks
+##########
+
+LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION
+CONFIGURE_FLAGS=""
+
+git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE
+
+pushd $LUAROCKS_BASE
+git checkout v$LUAROCKS_VERSION
+
+if [ "$LUAJIT" == "yes" ]; then
+ LUA_DIR=$LUAJIT_DIR
+elif [ "$LUA" == "lua5.1" ]; then
+ CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.1"
+elif [ "$LUA" == "lua5.2" ]; then
+ CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.2"
+elif [ "$LUA" == "lua5.3" ]; then
+ CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.3"
+fi
+
+./configure \
+ --prefix=$LUAROCKS_DIR \
+ --with-lua-bin=$LUA_DIR/bin \
+ --with-lua-include=$LUA_INCLUDE \
+ $CONFIGURE_FLAGS
+
+make build && make install
+popd
diff --git a/.ci/setup_openresty.sh b/.ci/setup_openresty.sh
new file mode 100755
index 0000000..0bff14e
--- /dev/null
+++ b/.ci/setup_openresty.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+if [ "$OPENRESTY_TESTS" != "yes" ]; then
+ exit
+ echo "Exiting, no openresty tests"
+fi
+
+set -e
+
+mkdir -p $OPENRESTY_DIR
+
+if [ ! "$(ls -A $OPENRESTY_DIR)" ]; then
+ OPENRESTY_BASE=ngx_openresty-$OPENRESTY_VERSION
+
+ curl https://openresty.org/download/$OPENRESTY_BASE.tar.gz | tar xz
+ pushd $OPENRESTY_BASE
+
+ ./configure \
+ --prefix=$OPENRESTY_DIR \
+ --with-luajit=$LUAJIT_DIR \
+ --without-http_coolkit_module \
+ --without-lua_resty_dns \
+ --without-lua_resty_lrucache \
+ --without-lua_resty_upstream_healthcheck \
+ --without-lua_resty_websocket \
+ --without-lua_resty_upload \
+ --without-lua_resty_string \
+ --without-lua_resty_mysql \
+ --without-lua_resty_redis \
+ --without-http_redis_module \
+ --without-http_redis2_module \
+ --without-lua_redis_parser
+
+ make
+ make install
+ popd
+fi
+
+git clone git://github.com/travis-perl/helpers travis-perl-helpers
+pushd travis-perl-helpers
+source ./init
+popd
+cpan-install Test::Nginx::Socket
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e1c601f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+nginx_tmp
+t/servroot
diff --git a/.luacheckrc b/.luacheckrc
index 65f5edb..908d580 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -1,2 +1,3 @@
unused_args = false
-globals = {"ngx", "describe", "setup", "teardown", "it", "pending"}
+redefined = false
+globals = {"ngx", "describe", "setup", "teardown", "it", "pending", "before_each", "after_each", "finally", "spy", "mock"}
diff --git a/.travis.yml b/.travis.yml
index 1a45d14..1ce7527 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,26 +1,50 @@
-language: erlang
-
+language: perl
+perl: "5.18"
+sudo: false
+notifications:
+ email: false
+addons:
+ apt:
+ packages:
+ - libreadline-dev
+ - libncurses5-dev
+ - libpcre3-dev
+ - libssl-dev
+ - build-essential
env:
global:
- - LUAROCKS=2.2.2
- - CASSANDRA_VERSION=2.1.8
+ - CASSANDRA_VERSION=2.1.9
+ - LUAROCKS_VERSION=2.2.2
+ - OPENRESTY_VERSION=1.9.3.1
+ - LUA_DIR=$HOME/lua
+ - LUAJIT_DIR=$HOME/luajit
+ - LUAROCKS_DIR=$HOME/luarocks
+ - OPENRESTY_DIR=$HOME/openresty
+ - "HOSTS=127.0.0.1,127.0.0.2,127.0.0.3"
+ - SMALL_LOAD=true
matrix:
- LUA=lua5.1
- LUA=lua5.2
- LUA=lua5.3
- - LUA=luajit
-
+ - LUA=luajit-2.1
+ - OPENRESTY_TESTS: "yes"
+ LUA: "luajit-2.1"
before_install:
- - bash .travis/setup_lua.sh
- - bash .travis/setup_cassandra.sh
- - sudo luarocks install luasocket
- - sudo make dev
-
-script:
- - "busted -v --coverage"
- - "make lint"
-
-after_success: "luacov-coveralls -i cassandra"
-
-notifications:
- email: false
+ - bash .ci/setup_cassandra.sh
+ - bash .ci/setup_lua.sh
+ - bash .ci/setup_openresty.sh
+ - export PATH=$LUA_DIR/src:$LUAJIT_DIR/bin:$LUAROCKS_DIR/bin:$OPENRESTY_DIR/nginx/sbin:$PATH
+ - export LUA_PATH="./?.lua;$LUAROCKS_DIR/share/lua/5.1/?.lua;$LUAROCKS_DIR/share/lua/5.1/?/init.lua;$LUAROCKS_DIR/lib/lua/5.1/?.lua;$LUA_PATH"
+ - export LUA_CPATH="$LUAROCKS_DIR/lib/lua/5.1/?.so;$LUA_CPATH"
+install:
+ - make dev
+ - luarocks install ansicolors
+script: .ci/run_tests.sh
+cache:
+ cpan: true
+ apt: true
+ pip: true
+ directories:
+ - $LUAJIT_DIR
+ - $OPENRESTY_DIR
+ - $HOME/.ccm/repository/
diff --git a/.travis/setup_cassandra.sh b/.travis/setup_cassandra.sh
deleted file mode 100755
index ae31144..0000000
--- a/.travis/setup_cassandra.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-CASSANDRA_BASE=apache-cassandra-$CASSANDRA_VERSION
-
-sudo rm -rf /var/lib/cassandra/*
-curl http://apache.spinellicreations.com/cassandra/$CASSANDRA_VERSION/$CASSANDRA_BASE-bin.tar.gz | tar xz
-sudo sh $CASSANDRA_BASE/bin/cassandra
diff --git a/.travis/setup_lua.sh b/.travis/setup_lua.sh
deleted file mode 100755
index e37d6cf..0000000
--- a/.travis/setup_lua.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#! /bin/bash
-
-# A script for setting up environment for travis-ci testing.
-# Sets up Lua and Luarocks.
-# LUA must be "lua5.1", "lua5.2" or "luajit".
-# luajit2.0 - master v2.0
-# luajit2.1 - master v2.1
-
-LUAJIT_BASE="LuaJIT-2.0.3"
-
-source .travis/platform.sh
-
-LUAJIT="no"
-
-if [ "$PLATFORM" == "macosx" ]; then
- if [ "$LUA" == "luajit" ]; then
- LUAJIT="yes";
- fi
- if [ "$LUA" == "luajit2.0" ]; then
- LUAJIT="yes";
- fi
- if [ "$LUA" == "luajit2.1" ]; then
- LUAJIT="yes";
- fi;
-elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
- LUAJIT="yes";
-fi
-
-if [ "$LUAJIT" == "yes" ]; then
-
- if [ "$LUA" == "luajit" ]; then
- curl http://luajit.org/download/$LUAJIT_BASE.tar.gz | tar xz;
- else
- git clone http://luajit.org/git/luajit-2.0.git $LUAJIT_BASE;
- fi
-
- cd $LUAJIT_BASE
-
- if [ "$LUA" == "luajit2.1" ]; then
- git checkout v2.1;
- fi
-
- make && sudo make install
-
- if [ "$LUA" == "luajit2.1" ]; then
- sudo ln -s /usr/local/bin/luajit-2.1.0-alpha /usr/local/bin/luajit
- sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua;
- else
- sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua;
- fi;
-
-else
- if [ "$LUA" == "lua5.1" ]; then
- curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
- cd lua-5.1.5;
- elif [ "$LUA" == "lua5.2" ]; then
- curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
- cd lua-5.2.3;
- elif [ "$LUA" == "lua5.3" ]; then
- curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz
- cd lua-5.3.0;
- fi
- sudo make $PLATFORM install;
-fi
-
-cd $TRAVIS_BUILD_DIR;
-
-LUAROCKS_BASE=luarocks-$LUAROCKS
-
-# curl http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
-
-git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE
-cd $LUAROCKS_BASE
-
-git checkout v$LUAROCKS
-
-if [ "$LUA" == "luajit" ]; then
- ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.0;
-elif [ "$LUA" == "luajit2.0" ]; then
- ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.0;
-elif [ "$LUA" == "luajit2.1" ]; then
- ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.1;
-else
- ./configure;
-fi
-
-make build && sudo make install
-
-cd $TRAVIS_BUILD_DIR
-
-rm -rf $LUAROCKS_BASE
-
-if [ "$LUAJIT" == "yes" ]; then
- rm -rf $LUAJIT_BASE;
-elif [ "$LUA" == "lua5.1" ]; then
- rm -rf lua-5.1.5;
-elif [ "$LUA" == "lua5.2" ]; then
- rm -rf lua-5.2.3;
-elif [ "$LUA" == "lua5.3" ]; then
- rm -rf lua-5.3.0;
-fi
diff --git a/LICENSE b/LICENSE
index 4040943..e0286b5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
The MIT License (MIT)
-Original work Copyright (c) 2014 Juarez Bochi
-Modified work Copyright 2015 Thibault Charbonnier
+Original work Copyright (c) 2015 Thibault Charbonnier
+Based on the work of Juarez Bochi Copyright 2014
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Makefile b/Makefile
index 61cd776..278a0b8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
DEV_ROCKS=busted luacov luacov-coveralls luacheck ldoc
-.PHONY: dev clean test coverage lint doc
+.PHONY: install dev clean test coverage lint doc
-dev:
+install:
+ @luarocks make lua-cassandra-*.rockspec
+
+dev: install
@for rock in $(DEV_ROCKS) ; do \
if ! command -v $$rock &> /dev/null ; then \
echo $$rock not found, installing via luarocks... ; \
@@ -13,7 +16,7 @@ dev:
done;
test:
- @busted -v
+ @busted -v && prove
clean:
@rm -f luacov.*
@@ -23,7 +26,7 @@ coverage: clean
@luacov cassandra
lint:
- @find . -not -path './doc/*' -name '*.lua' | xargs luacheck -q
+ @find src spec -not -path './doc/*' -name '*.lua' | xargs luacheck -q
doc:
@ldoc -c doc/config.ld src
diff --git a/README.md b/README.md
index 3d276e9..924f472 100644
--- a/README.md
+++ b/README.md
@@ -1,105 +1,195 @@
# lua-cassandra ![Module Version][badge-version-image] [![Build Status][badge-travis-image]][badge-travis-url] [![Coverage Status][badge-coveralls-image]][badge-coveralls-url]
-> This project is a fork of [jbochi/lua-resty-cassandra][lua-resty-cassandra]. It adds support for binary protocol v3, a few bug fixes and more to come. See the improvements section for more details.
+A pure Lua client library for Apache Cassandra (2.0+), compatible with Lua and [ngx_lua].
-Lua Cassandra client using CQL binary protocol v2/v3 for Cassandra 2.0 and later.
+It is build following the example of the official Datastax drivers, and tries to implement the same behaviors, options and features.
-It is 100% non-blocking if used in Nginx/Openresty but can also be used with luasocket.
+## Table of Contents
-## Installation
+- [Features](#features)
+- [Usage](#usage)
+- [Installation](#installation)
+- [Documentation and Examples](#documentation-and-examples)
+- [Test Suite](#test-suite)
+- [Tools](#tools)
+
+## Features
+
+- Leverage the ngx_lua cosocket API (non-blocking, reusable sockets)
+- Fallback on LuaSocket for plain Lua compatibility
+- Simple, prepared and batch statements
+- Cluster topology automatic discovery
+- Configurable load balancing, reconnection and retry policies
+- TLS client-to-node encryption
+- Client authentication
+- Highly configurable options per session/query
+- Compatible with Cassandra 2.0 and 2.1
+- Works with Lua 5.1, 5.2, 5.3 and LuaJIT 2.x
+
+## Usage
+
+With ngx_lua:
+
+```nginx
+http {
+ # you do not need the following line if you are using luarocks
+ lua_package_path "/path/to/src/?.lua;/path/to/src/?/init.lua;;";
+
+ # all cluster informations will be stored here
+ lua_shared_dict cassandra 1m;
+
+ server {
+ ...
+
+ location / {
+ content_by_lua '
+ local cassandra = require "cassandra"
+
+ local session, err = cassandra.spawn_session {
+ shm = "cassandra", -- defined by "lua_shared_dict"
+ contact_points = {"127.0.0.1"}
+ }
+ if err then
+ ngx.log(ngx.ERR, "Could not spawn session: ", tostring(err))
+ return ngx.exit(500)
+ end
+
+ local res, err = session:execute("INSERT INTO users(id, name, age) VALUES(?, ?, ?)", {
+ cassandra.uuid("1144bada-852c-11e3-89fb-e0b9a54a6d11"),
+ "John O Reilly",
+ 42
+ })
+ if err then
+ -- ...
+ end
+
+ local rows, err = session:execute("SELECT * FROM users")
+ if err then
+ -- ...
+ end
+
+ session:set_keep_alive()
+
+ ngx.say("rows retrieved: ", #rows)
+ ';
+ }
+ }
+}
+```
+
+With plain Lua:
+
+```lua
+local cassandra = require "cassandra"
+
+local session, err = cassandra.spawn_session {
+ shm = "cassandra",
+ contact_points = {"127.0.0.1", "127.0.0.2"}
+}
+assert(err == nil)
+
+local res, err = session:execute("INSERT INTO users(id, name, age) VALUES(?, ?, ?)", {
+ cassandra.uuid("1144bada-852c-11e3-89fb-e0b9a54a6d11"),
+ "John O'Reilly",
+ 42
+})
+assert(err == nil)
+
+local rows, err = session:execute("SELECT * FROM users")
+assert(err == nil)
+
+print("rows retrieved: ", #rows)
+
+session:shutdown()
+```
-#### Luarocks
+## Installation
-Installation through [luarocks][luarocks-url] is recommended:
+With [Luarocks]:
```bash
$ luarocks install lua-cassandra
```
-#### Manual
+Manually:
-Simply copy the `src/` folder in your application.
+Once you have a local copy of this module's `src/` fo lder, add it to your `LUA_PATH` (or `lua_package_path` for ngx_lua):
-## Usage
+```
+/path/to/src/?.lua;/path/to/src/?/init.lua;
+```
-```lua
-local cassandra = require "cassandra"
--- local cassandra = require "cassandra.v2" -- binary protocol v2 for Cassandra 2.0.x
+**Note**: If used *outside* of ngx_lua, this module requires:
+
+- [LuaSocket](http://w3.impa.br/~diego/software/luasocket/)
+- If you wish to use TLS client-to-node encryption, [LuaSec](https://github.com/brunoos/luasec)
-local session = cassandra:new()
-session:set_timeout(1000) -- 1000ms timeout
+## Documentation and examples
-local connected, err = session:connect("127.0.0.1", 9042)
-assert(connected)
-session:set_keyspace("demo")
+The current [documentation] targets version `0.3.6` only. `0.4.0` documentation should come soon.
--- simple query
-local table_created, err = session:execute [[
- CREATE TABLE users(
- id uuid PRIMARY KEY,
- name varchar,
- age int
- )
-]]
+## Test Suite
--- query with arguments
-local ok, err = session:execute("INSERT INTO users(name, age, user_id) VALUES(?, ?, ?)"
- , {"John O'Reilly", 42, cassandra.uuid("1144bada-852c-11e3-89fb-e0b9a54a6d11")})
+This library uses three test suites:
+- Unit tests, with busted
+- Integration tests, with busted and a running Cassandra cluster
+- ngx_lua integration tests with Test::Nginx::Socket and a running Cassandra cluster
--- select statement
-local users, err = session:execute("SELECT name, age, user_id FROM users")
-assert(1 == #users)
+- The first can simply be run after installing [busted](http://olivinelabs.com/busted/) and running:
-local user = users[1]
-print(user.name) -- "John O'Reilly"
-print(user.user_id) -- "1144bada-852c-11e3-89fb-e0b9a54a6d11"
-print(user.age) -- 42
+```shell
+$ busted spec/unit
```
-You can check more examples on the [documentation][documentation-reference] or in the [tests](https://github.com/thibaultcha/lua-cassandra/blob/master/spec/integration_spec.lua).
+- The integration tests are located in another folder, and require a Cassandra instance (currently 2.1+) to be running. Your cluster's hosts (not just the contact points, but all of them) should be declared in the `HOSTS` environment variable:
-## Documentation and examples
+```shell
+$ HOSTS=127.0.0.1,127.0.0.2,127.0.0.3 busted spec/integration
+```
+
+Finally, the ngx_lua integration tests can be run after installing the [Test::Nginx::Socket](http://search.cpan.org/~agent/Test-Nginx-0.23/lib/Test/Nginx/Socket.pm) module and also require a Cassandra instance to run on `localhost`:
-Refer to the online [manual][documentation-manual] and [reference][documentation-reference].
+```shell
+$ prove t/
+```
-## Improvements
+## Tools
-This fork provides the following improvements over the root project:
+This module can also use various tools for code quality, they can easily be installed from Luarocks by running:
-- [x] Support for binary protocol v3
- - [x] User Defined Types and Tuples support
- - [x] Serial Consistency support for batch requests
-- [x] Support for authentication
-- [x] Keyspace switch fix
-- [x] IPv6 encoding fix
+```
+$ make dev
+```
-## Roadmap
+Code coverage is analyzed by [luacov](http://keplerproject.github.io/luacov/) from the **busted** (unit and integration) tests:
-- [ ] Support for binary protocol v3 named values when binding a query
-- [ ] Support for binary protocol v3 default timestamp option
-- [ ] Support for binary protocol v4
+```shell
+$ busted --coverage
+$ luacov cassandra
+# or
+$ make coverage
+```
-## Makefile Operations
+The code is linted with [luacheck](https://github.com/mpeterv/luacheck). It is easier to use the Makefile again to avoid analyzing Lua files that are not part of this module:
-When developing, use the `Makefile` for doing the following operations:
+```shell
+$ make lint
+```
-| Name | Description |
-| -------------:| ----------------------------------------------|
-| `dev` | Install busted, luacov and luacheck |
-| `test` | Run the unit tests |
-| `lint` | Lint all Lua files in the repo |
-| `coverage` | Run unit tests + coverage report |
-| `clean` | Clean coverage report |
+The documentation is generated by [ldoc](https://github.com/stevedonovan/LDoc) and can be generated with:
-**Note:** Before running `make lint` or `make test` you will need to run `make dev`.
+```shell
+$ ldoc -c doc/config.ld src
+# or
+$ make doc
+```
-**Note bis:** Tests are running for both binary protocol v2 and v3, so you must ensure to be running Cassandra `2.O` or later.
+[ngx_lua]: https://github.com/openresty/lua-nginx-module
-[luarocks-url]: https://luarocks.org
-[lua-resty-cassandra]: https://github.com/jbochi/lua-resty-cassandra
-[documentation-reference]: http://thibaultcha.github.io/lua-cassandra/
-[documentation-manual]: http://thibaultcha.github.io/lua-cassandra/manual/README.md.html
+[Luarocks]: https://luarocks.org
+[documentation]: http://thibaultcha.github.io/lua-cassandra/
+[manual]: http://thibaultcha.github.io/lua-cassandra/manual/README.md.html
[badge-travis-url]: https://travis-ci.org/thibaultCha/lua-cassandra
[badge-travis-image]: https://img.shields.io/travis/thibaultCha/lua-cassandra.svg?style=flat
@@ -107,4 +197,4 @@ When developing, use the `Makefile` for doing the following operations:
[badge-coveralls-url]: https://coveralls.io/r/thibaultCha/lua-cassandra?branch=master
[badge-coveralls-image]: https://coveralls.io/repos/thibaultCha/lua-cassandra/badge.svg?branch=master&style=flat
-[badge-version-image]: https://img.shields.io/badge/version-0.3.6--0-blue.svg?style=flat
+[badge-version-image]: https://img.shields.io/badge/version-0.4.0--0-blue.svg?style=flat
diff --git a/doc/examples/authentication.lua.html b/doc/examples/authentication.lua.html
index 01f2e3f..855d1ef 100644
--- a/doc/examples/authentication.lua.html
+++ b/doc/examples/authentication.lua.html
@@ -26,9 +26,6 @@
-------- --- Example with the PasswordAuthenticator IAuthenticator +-- Example with thePasswordAuthenticator
IAuthenticator -- @see http://docs.datastax.com/en/cassandra/1.2/cassandra/security/security_config_native_authenticate_t.html local cassandra = require "cassandra" @@ -79,7 +72,7 @@authentication.lua
generated by LDoc 1.4.3 -Last updated 2015-08-14 20:05:42 +Last updated 2015-12-11 01:52:31