lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

This is a project of mine that has been sitting without a release for
a long time now.
With luapgsql recently getting the last fixes I was waiting for, I
figured it's time to do a proper release.

cqueues-pgsql is a library that wraps luapgsql to be non-blocking when
in a cqueues managed thread.
The API should be the same as luapgsql; if it diverges, file a bug with me :)
Available on luarocks:

Q. What is luapgsql?
A. Bindings to libpq, i.e. a postgresql client.

Q. What is cqueues?
A. A library for cooperative threading in lua.

Q. When do I want to use cqueues-pgsql?
A. When you want to talk to postgres without blocking your entire

Q. So I can only use it in a cqueues managed thread/application?
A. No! if used outside of a cqueues managed thread, cqueues-pgsql will
appear to operate in a blocking manner.
i.e. it will look and behave just like luapgsql.

Q. Show me an example!
A. That's not a question, but okay:
$ lua
Lua 5.3.3  Copyright (C) 1994-2016, PUC-Rio
> require"cqueues_pgsql".connectdb"":exec("SELECT 42"):getvalue(1,1)