cassandra-client-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juarez Bochi <jbo...@gmail.com>
Subject Re: Lua CQL driver
Date Wed, 09 Jul 2014 22:12:25 GMT
Thank you, Tyler.
On Jul 9, 2014 6:43 PM, "Tyler Hobbs" <tyler@datastax.com> wrote:

> Awesome!  I've added it to the Wiki list of drivers here:
> https://wiki.apache.org/cassandra/ClientOptions
>
> You should also mention this on the Cassandra user mailing list.
>
>
> On Wed, Jul 9, 2014 at 4:32 PM, Juarez Bochi <jbochi@gmail.com> wrote:
>
> > Hi,
> >
> > I have started the development of a cassandra cql driver in Lua.
> >
> > The code is available at https://github.com/jbochi/lua-resty-cassandra.
> >
> > It is missing some features
> > <https://github.com/jbochi/lua-resty-cassandra/issues?state=open> and
> > lacks
> > support for several types
> > <https://github.com/jbochi/lua-resty-cassandra/issues/16>but is already
> > usable:
> >
> >       session = cassandra.new()
> >       session:set_timeout(1000)
> >       connected, err = session:connect("127.0.0.1", 9042)
> >
> >       session:set_keyspace("lua_tests")
> >
> >       local table_created, err = session:execute([[
> >           CREATE TABLE users (
> >             user_id uuid PRIMARY KEY,
> >             name varchar,
> >             age int
> >           )
> >       ]])
> >
> >       local ok, err = session:execute([[
> >         INSERT INTO users (name, age, user_id)
> >         VALUES (?, ?, ?)
> >       ]], {"Juarez S' Bochi", 31, {type="uuid",
> > value="1144bada-852c-11e3-89fb-e0b9a54a6d11"}})
> >       local users, err = session:execute("SELECT name, age, user_id from
> > users")
> >       assert.same(1, #users)
> >       local user = users[1]
> >       assert.same("Juarez S' Bochi", user.name)
> >       assert.same("1144bada-852c-11e3-89fb-e0b9a54a6d11", user.user_id)
> >       assert.same(31, user.age)
> >       assert.truthy(ok)
> >
> >
> > Contributions and suggestions are welcome!
> >
> > https://github.com/jbochi/lua-resty-cassandra
> >
> > Thanks,
> > Juarez Bochi
> >
>
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message