Using Lua with eXtremeSQL

eXtremeSQL supports the Lua programming language using the LuaJIT translator. The LuaJIt 2.1.0-beta3 is recommended and can be found at LuaJIT is a low-level scripting language that is translated directly to machine code; also a low-level FFI interface is used internally to directly call native functions. This provides good performance, but may not be error-proof, so programming with LuaJIT requires attention. eXtremeSQL packages include the appropriate version of Lua with some modifications to the Lua libraries to support specific eXtremeSQL implementation needs. Lua syntax is described in Appendix C.

Though Lua is not available as a native language eXtremeDB API, it can be used to access eXtremeDB databases in the context of the eXtremeSQL engine. The Lua language can be used for both user defined functions and for performing scripts in Lua language.

A user defined function (UDF) is a Lua program that executes on the server, can be called like any other SQL function and can return results to the SQL engine as a query result or to use in subsequent SQL subqueries. In fact, This UDF acts as an extension to the server. A UDF can be one of two types:

Using Lua as a script, which works as a separate program, it is possible to create a database, connect to an existing database, perform DDL and DML statements and process query results.

Please use links in the following table to view topics of interest:

Quick Start Setting up the Lua environment
Data Type Mappings Lua Data Types
Creating UDFs Creating Lua UDFs
Scripting Creating Lua scripts
eXtremeSQL Interface How Lua interfaces with eXtremeSQL
Tips and Tricks Some important tips
API Reference The eXtremeSQL Lua API reference
Lua Reference Manual The Lua Language Reference Manual