lua-users home
lua-l archive

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


Doesn't MySQL have some variant of command line operations, though?

--------------------------------------------------
From: "Javier Guerra" <javier@guerrag.com>
Sent: Monday, February 08, 2010 P12:16
Newsgroups: gmane.comp.lang.lua.general
To: "Lua list" <lua@bazar2.conectiva.com.br>
Subject: Re: MySQL in LUA

On Mon, Feb 8, 2010 at 2:11 PM, BLAKEscIence bs <fulgencio@gmail.com> wrote:
Do you think that the '.dll' file is the only way to use MySQL with LUA
scripts???

absolutely.

the problem is that on one hand you have Lua, and on the other hand
you have a C library that doesn't know anything about Lua (the MySQL
client library).  the only way to bind those is to write a new C
library that uses both the MySQL C API and the Lua C API.  that's what
you call "the .dll".  AKA a binding library.

what other possible solutions could be?

- you could write a binding in Lua with the Alien library; but Alien
is also a C library.

- in theory you could directly write to the MySQL wire protocol,
bypassing the MySQL client library; but that means using a library
like LuaSocket to get to the wire.  And yes, LuaSocket is also a C
library

in short: if you have Lua but can't extend it, there's a lot you won't
be able to do.

--
Javier