Skip to content
golgote edited this page Sep 14, 2010 · 14 revisions

Frigo is a database wrapper written in Lua which works on top of LuaSQL

About

Frigo provides two main features:

  1. A database wrapper
  2. A simple ORM solution

The database wrapper is a lightweight adaptation of PEAR::DB, a popular database wrapper in PHP. The ORM part is based on a similar project I have created for PHP which I use daily on my production websites but was never release to public. Ultimately, **Frigo**’s goal is to make it easier to use LuaSQL and write less code and SQL, which ends up in code that is easier to maintain and port.

Ideas behind Frigo

Frigo is not a complete ORM solution like Hibernate or SQLAlchemy. It concentrates on making my developer’s life easier and at the same time does not venture into the risky areas of the ORM problem. This means that Frigo is using pure SQL and does not try to provide an abstraction for it because I consider this language a must-know for database users, so there is no need to learn yet another way to write SQL.

Frigo is also not a database abstraction. If your SQL is only working with a specific database system, don’t expect your application to work on another system. Frigo provides an adapter which will try to abstract basic operations like escaping values, limiting results, getting table information, but nothing too fancy.

Requirements

Frigo requires at least LuaSQL 2.2 to work since it relies on client’s native escape functions.
Frigo supports the following database systems:

  • MySQL
  • Sqlite
  • Sqlite3

Adding support for another database system is quite easy: all you need is write a new adapter which provides methods to get metadata about the database. Feel free to send me your code.

License

Frigo uses the same license as Lua 5.0 and later.

Copyright © 2008 Bertrand Mansion, Mamasam.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Clone this wiki locally