Questions tagged [luasql]

LuaSQL is a simple interface from Lua to a number of database management systems. It includes a set of drivers to some popular databases (currently PostgreSQL, ODBC, MySQL, SQLite, Oracle, and ADO).

LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to:

  • Connect to ODBC, ADO, Oracle, MySQL, SQLite and PostgreSQL databases;
  • Execute arbitrary SQL statements;
  • Retrieve results in a row-by-row cursor fashion.

LuaSQL is a simple interface from Lua to a number of database management systems. It includes a set of drivers to some popular databases (currently PostgreSQL, ODBC, MySQL, SQLite, Oracle, and ADO). It defines a simple object-oriented API. All drivers should implement this common API, but each one is free to offer extensions. It is free software. It's latest version is LuaSQL 2.1.1 released on October 29th, 2007.

It was originally designed by Pedro Miller Rabinovitch and Roberto Ierusalimschy. The first implementation was compatible with Lua 4.0a and its development was sponsored by Fábrica Digital, FINEP and CNPq.

LuaSQL's progress can be tracked on its github project page.

44 questions
0
votes
0 answers

Loading luasql-mysql in CMD

I finally installed (I think) luasql-mysql in windows but I can't seem to run local mysql = require("luasql-mysql"). Below are the relevant images: Image of Installed luasql-mysql . Error in simple command It seems like I only have mysql.dll after…
bonez001
  • 1
  • 3
0
votes
0 answers

Cannot install luasql using luarocks

I'm having a problem installing luasql using luarocks. As I understand, I need to do it in command prompt. I already did the necessary preparations: I installed lua 5.1 because I need this version. I installed luarocks and mysql. I also added in…
bonez001
  • 1
  • 3
0
votes
0 answers

How do I install luasql in Visual Studio Command Prompt 2015?

I am new in using luasql. I want to use it in Love2d. I already installed lua (Lua 5.3) and luarocks. I also installed MySQL using the msi installer. Now I think am ready to install luasql but I have the following error if I use the Visual studio…
bonez001
  • 1
  • 3
0
votes
1 answer

Assert C/C++ on LuaSQL code

I´d like to know what happens on this code, taken from the LuaSQL code (It´s on the LuaSQL source - file ls_OCI8.c). I want to understand what this piece of code does (to be more specific: I want to understand what the ASSERT function is doing).…
Alucard
  • 16,628
  • 7
  • 24
  • 23
0
votes
0 answers

Connecting Sybase from Lua

According this link LuaSQL LuaSql has plans for a driver for Sybase. The doc is not a recent one. So can anybody please tell me if it was indeed launched. If not what would be a work-around for connecting Sybase from Lua?
callow
  • 517
  • 1
  • 4
  • 15
0
votes
1 answer

How do I close all open cursors in Lua?

What's the proper pattern to close all open cursors in a lua script before closing the db connection? I have a helper function rows() that is called in multiple places which creates cursors, on the function end() I want to be able to close all that…
Neil
  • 7,042
  • 9
  • 43
  • 78
0
votes
1 answer

Compilation issues with ntopng

I am trying to install ntopng on CentOS 5.5. When I run the make command, during the compilation process I am getting an error related to the sqlite library. I have sqlite v3.3.6 installed. src/../third-party/lsqlite3/lsqlite3.c: In function 'int…
user1718159
  • 561
  • 1
  • 6
  • 12
0
votes
1 answer

How to connect to Mysql from Lua with local-infile=1

I am connecting to a mysql database from lua using : mysql = require "luasql.mysql" local env = mysql.mysql() local conn = env:connect(database,userName,password) but the option local-infile is not activated so my requests using LOAD DATA don't…
guadoc
  • 1
  • 2
0
votes
0 answers

When would mysql_field_count() return 0 for a SELECT statement?

When I was using luasql to query a MySQL database, I met a strange error, which, appeared to be caused by mysql_field_count()'s unexpectedly returning 0 for a SELECT statement. I have two existing databases A, B and the following lua code: local…
hslaster
  • 45
  • 4
0
votes
1 answer

Lua insert statement

I'm having problems with my insert statement: Create = function (LN,FN,Add,Tel,Cell) LastName = tostring(LN); FirstName = tostring(FN); Address = tostring(Add); Telephone =tostring(Tel); Cellphone = tostring(Cell); --source of…
0
votes
1 answer

The os.date function isn't returning desired outcomes

I'm inserting a string variable to my MySQL table using this os.date() function call: tSend["sDate"] = os.date( "%Y-%m-%d %X", Core.GetUserValue(v, 25) ) The table tSend is forwarded to another function which inserts it into the table. This doesn't…
hjpotter92
  • 78,589
  • 36
  • 144
  • 183
0
votes
1 answer

A procedure or a loop

I've a table named messages where users of my local hub store their messages(kind of like a web-forums). Currently, a majority of users are participating and I get nearly 30 to 50 new entries to my table everyday. Since this has been going on for…
hjpotter92
  • 78,589
  • 36
  • 144
  • 183
0
votes
1 answer

lua-CoatPersistent, would this work with Corona SDK?

The concept of "lua-CoatPersistent" looks very appealing re higher level usage of a sqlite database in Corona. Anyone know if this would work under Corona? If you've got it working any tips/learnings re how to get it all setup/working? i.e. any…
Greg
  • 34,042
  • 79
  • 253
  • 454
-1
votes
1 answer

Error: bad argument #1 to 'insert' (table expected, got nil)

I am trying to connect to a mysql server using LuaSql via a mysql proxy. I try to execute a simple program (db.lua): require("luasql.mysql") local _sqlEnv = assert(luasql.mysql()) local _con = nil function read_auth(auth) local host, port =…
robin
  • 19
  • 1
  • 10
1 2
3