Dado
Database Facilities for LuaSQL
english·português

Overview

Dado is a package that offers some facilities implemented over LuaSQL connection objects. Its main goals are:

  • better error messages,
  • iterators to access the result set and
  • more homogeneity in some commonly used database operations.

Dado is free software and uses the same license as Lua.

Object Abstraction

The package also contains an object module which provides a way to define classes and objects to represent table rows with a minimun effort. It does not imposes a class system, it just suggests a simple one with simple inheritance:

  • objects with automatic retrieval of database attributes
  • different methods for object creation and for class definition

The default mechanism uses classes to represent database tables and instances to represent database table rows. However it is easy to define attributes that are not related to database columns, or classes that are not related to only one database table.

Status

Current version is 1.5.2. It was developed for both Lua 5.1 and Lua 5.2.

Download

Dado can be downloaded from its own download page.

Installation

Dado is a Lua 5 (compatible with all Lua 5.X versions) set of modules which should be installed in your LUA_PATH, respecting the directory structure in the src folder of the distribution file.

LuaRocks can be used to install it since Dado is also distributed as a rock.

Manual

There is no reference manual. The API is documented with LDoc.

History

  • [15/oct/2013] Version 1.5.2 released
      Bug correction in sql.quote: it does not quote strings which are formed by double balanced parentheses, such as ((NULL)) or ((select col from tab where cond)); it does not quote Lua numbers (but it does quote strings with numbers inside it)
  • [4/oct/2013] Version 1.5.1 released
    • sql.escape now follows strictly the SQL standard: it does not try to escape everything, only the string delimiter character '; also it does not remove three special characters: TAB (\t or \9), LINE FEED (\n or \10) and CARRIAGE RETURN (\r or \13)
    • sql.quote does NOT quote Lua numbers (but it does quote strings with numbers inside it, such as '12') NOR strings which are formed by a balanced parentheses into which there could be: only an identifier (without digits); or a string containing 'select' substring
    • sql.insert also accepts a single string with the entire SQL statement (except the first two words: insert into)
  • [23/jan/2013] Version 1.4.3 released
    Bug correction in function sql.escape: removes characters with codes < 32 to avoid problems in SQL code generation
  • [13/nov/2012] Version 1.4.2 released
    • Reimplementation to make it work with Lua 5.2
    • Improvement in function sql.escape: third parameter must be a substitution pattern
  • [06/jun/2011] Version 1.4 released
    Clean up of unused functions: arraytorecord, invert, copyto and cycle from module table.extra and whole string.extra module
  • [14/dec/2010] Version 1.3.1 released
    Bug correction in function sql.quote: it was not quoting strings that begin and end with parenthesis which don't match
  • [06/aug/2010] Version 1.3.0 released
  • [10/jun/2010] Version 1.2.0 released
  • [05/oct/2009] Version 1.1.0 released
  • [29/sep/2009] Version 1.0.1 released
    Bug correction in function sql.quote
  • [20/apr/2008] Version 1.0 released

Credits

Dado was designed by Tomás Guisasola and Eduardo Quintão with many priceless contributions from Pedro Maia, Roberto Ierusalimschy, André Carregal, Raphael Pithan, Maurício Bonfim and Carla Ourofino. The logo image was made by Carla Ourofino.

Dado was developed for PUC-Rio which holds its copyright. It was implemented by Tomás Guisasola.

Contact us

For more information please contact us. Comments are welcome!

Valid XHTML 1.0!

$Id: index.html,v 1.31 2013-10-15 19:25:08 tomas Exp $