-
Notifications
You must be signed in to change notification settings - Fork 4
Home
A lightweight binding of the libpq client library for PostgreSQL
2011.07.31
Lua-PgSQL is provided under the simplified BSD license:
Copyright 2011 Stefan Peters. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE ORIGINAL AUTHOR ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lua-PgSQL is a purpose built Lua module designed for the fast and efficient manipulation of a PostgreSQL database using the official libpq client libraries. As this is a lightweight binding, some of this documentation is sourced directly from the PostgreSQL manual. The current version can be downloaded from here:
http://github.com/STPeters/luapgsql/downloads
The base functions only serve to configure the client libraries and provide a connection object that is used to prepare data and execute SQL commands. Once a command is executed, a result object is created. This object is used to perform all of the data retrieval operations.
The object methods are arranged where more functionality is provided the further up the hierarchy you go. This allows for identical libraries to be made for almost any database. One could imagine a Lua-MySQL binding built from these sources with relatively minor modifications…
- Lua 5.1+
- PostgreSQL 8.2+ Client