lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


First hit on Google:

https://github.com/moteus/lua-odbc


Am 11.01.2021 um 12:42 schrieb Pierre Chapuis <catwell@archlinux.us>:

I just wanted to share this with the list in case others feel the same way.

I usually write code that runs on unices, but in my current position I happen to regularly write small pieces of code which run in customers' environments, typically as scheduled tasks.

The other day I had such a simple task: connect to a proprietary database using ODBC and extract some data as CSV.

Initially I tried to use Lua for it. I fell into a rabbit hole. I could find no decent documentation about the best way to achieve this: get a Lua interpreter that can speak ODBC on Windows, and run my script with it. I couldn't find a binary module for lua-odbc or LuaSQL-ODBC, or a distribution that includes one of them. I couldn't find decent documentation about how to start from scratch on Windows and achieve this (including installing a compiler if needed, luarocks, etc, or how to easily build a module to work with LuaBinaries [1] for instance).


That was a task for work so eventually I had to do the reasonable thing and give up. I googled TCL + ODBC and noticed it was in their standard library. I downloaded freeWrap [2], wrote a quick script and called "freewrapTCLSH.exe my_script.tcl". I obtained an executable I just had to drop on the customer's machine.


This makes me a little sad because Lua would be perfect for this task. This is not about ODBC being in the TCL standard library. Even if it wasn't they have a way to do the same almost as easily with third party modules [3].

It is just about it being too hard to just run some code with a C dependency on Windows (without something like msys2). On Linux or Mac it is reasonably easy but on Windows we really lack either a distribution with an extensive collection of binary modules (for instance a 3rd party repository relying on LuaBinaries), or a simple way to build standalone executables with C deps from scratch (for instance a distribution of MinGW + Lua + LuaRocks).

Does anyone here have the same problem, a solution (I might just not know the Lua on Windows ecosystem well enough) or a project that aims to solve this?

[1] http://luabinaries.sourceforge.net
[2] http://freewrap.sourceforge.net
[3] http://tclexecomp.sourceforge.net/documentation/customize/

--
Pierre Chapuis