[sqlite] Lua inside SQLite

2015-08-26 Thread Abilio Marques
Today I published a revamped version of the plugin, still at: https://github.com/abiliojr/sqlite-lua. This version allows the user to define a function. For example, cosine function would be defined like: SELECT createlua('cos', 'return math.cos(arg[1])'); After that, the function cos is

[sqlite] Lua inside SQLite

2015-08-26 Thread Nelson, Erik - 2
Abilio Marques wrote on Sunday, August 23, 2015 4:42 PM > > 3. Lua can return arrays. Also, Lua can return multiple values. Tried > to take advantage of those facts, but while reading the SQLite API > documentation, found no function where I could map multiple values as > the return of a

[sqlite] Lua inside SQLite

2015-08-24 Thread Dominique Devienne
On Sun, Aug 23, 2015 at 10:55 PM, Richard Hipp wrote: > Regular SQL functions always return scalars in SQLite. > > See https://www.sqlite.org/src/artifact/b8fb7befd85b3a9b for an > example of how to implement table-valued functions. This is a new > feature so there is no documentation on it

[sqlite] Lua inside SQLite

2015-08-23 Thread Darko Volaric
Wow, what a great feature. This saves me so much hacking! I planned on using virtual tables but per-query instance creation and parameter passing was going to be such a mess. On Sun, Aug 23, 2015 at 1:55 PM, Richard Hipp wrote: > On 8/23/15, Abilio Marques wrote: > > > > 1. sqlite3 CLI

[sqlite] Lua inside SQLite

2015-08-23 Thread Richard Hipp
On 8/23/15, Abilio Marques wrote: > > 1. sqlite3 CLI doesn't seem to "load" the .so easily... The generated so is > called "lua.ext". If I run "*.load lua.ext*" it claims that there is no .so > available. I went into renaming the file to lua.so, and ran *.load lua.so* > ... Got: *Error: Shared

[sqlite] Lua inside SQLite

2015-08-23 Thread Abilio Marques
Hi, I'm a regular user of SQLite, but a first timer in this list. A few months ago, while doing some intensive but manual data processing, I created (hacked) a loadable module that allowed me to run short Lua scripts directly inside the SQL queries. That eased a lot of the work that day. I'm