Git Product home page Git Product logo

cqlcl's Introduction

CQLCL

A Common Lisp client to Cassandra using the native protocol (V2)

Installation

QuickLisp is probably the most sane way to install CL libraries. Ensure you have this set up and working.

cd $QUICKLISP_HOME/local-projects
git clone https://github.com/AeroNotix/cqlcl.git
sbcl --eval "(ql:quickload :cqlcl)"

This will install all required dependencies.

API

(defparameter *cxn* (cqlcl:make-connection))
(let ((create-keyspace "CREATE KEYSPACE cqlcl
                        WITH replication = {
                            'class': 'SimpleStrategy', 'replication_factor': '1'
                        }"))
  (query *cxn* create-keyspace))
;; T
;; "CREATED: cqlcl."
(let ((create-table "CREATE TABLE cqlcl.readme (
                         id uuid PRIMARY KEY,
                         name text,
                         value int
                     )"))
    (query *cxn* create-table))
;; T
;; "CREATED: cqlcl.readme

(query *cxn* "SELECT * FROM cqlcl.readme")
;; NIL

(prepare *cxn* "INSERT INTO cqlcl.readme (id, name, value) VALUES(?, ?, ?)")
;; No value

(execute *cxn* "INSERT INTO cqlcl.readme (id, name, value) VALUES(?, ?, ?)"
    (uuid:make-v4-uuid) "HELLO" 123)
;; No value
(execute *cxn* "INSERT INTO cqlcl.readme (id, name, value) VALUES(?, ?, ?)"
    (uuid:make-v4-uuid) "HELLO" 123)
;; No value
(execute *cxn* "INSERT INTO cqlcl.readme (id, name, value) VALUES(?, ?, ?)"
    (uuid:make-v4-uuid) "HELLO" 123)
;; No value

(query *cxn* "SELECT * FROM cqlcl.readme")

((B16805B2-FDA8-4DF5-811B-77F46FFE2BBB "HELLO" 123)
 (DF0922E4-BB82-4C59-A32C-CBFD859CC3AD "HELLO" 123)
 (43B0683F-8372-4BFC-B2CB-93706360A2D7 "HELLO" 123))

Type mappings

Cassandra type CL type
ascii string
bigint integer
blob byte-vector
boolean boolean
counter not implemented
decimal float
double float
float float
inet cqlcl:ip
int integer
timestamp integer
timeuuid uuid:uuid
uuid uuid:uuid
varchar/text string
varint not implemented
list list
set list
map hashtbale
custom not implemented

cqlcl's People

Contributors

aeronotix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cqlcl's Issues

Implement async client

Now that the core binary protocol is done - write an async client

Utilize lparallel's channels?

Implement native protocol

I've totally forgotten what I've done and what not

  • Types
  • int read/write
  • int test
  • short read/write
  • short test
  • string read/write
  • string test
  • long string read/write
  • long string test
  • uuid read/write
  • uuid test
  • short/long bytes read/write
  • short/long bytes test
  • option read/write
  • option test
  • option list read/write
  • option list test
  • inet read/write
  • inet test
  • consistency read/write
  • consistency test
  • string map read/write
  • string map test
  • string multimap read/write
  • string multimap test
  • boolean read/write
  • boolean test
  • Messages
  • options
  • options test
  • startup
  • startup test
  • credentials
  • credentials test
  • query
  • query test
  • execute
  • execute test
  • register
  • register test
  • Responses
  • error
  • error test
  • ready
  • ready test
  • auth
  • auth test
  • supported
  • supported test
  • result
  • result test
  • void
  • void test
  • rows
  • rows test
  • set keyspace
  • set keyspace test
  • prepared
  • prepared test
  • schema change
  • schema change test
  • Events
  • Compression
  • Error codes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.