lua-users home
lua-l archive

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


Greg Hill wrote:
I'm using LuaSQL with a sqlite3 database.  I would like to store binary data in
the database or at least some data with singles quotes.  Can someone point me to
an example of how to do this?

Use the connection's 'escape' method to deal with single quotes and any other DB specific problem chars in a string:

safe_str = con:escape("can't")

Binary data itself is rather awkward and not something LuaSQL specifically handles in it's current state. The queries are passed as strings, so embedded zeros can cause problems when handling BLOBs.

Scott