[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaSQL and binary data
- From: "Javier Guerra" <javier@...>
- Date: Thu, 30 Oct 2008 11:41:45 -0500
On Thu, Oct 30, 2008 at 10:38 AM, Scott Morgan <email@example.com> wrote:
> 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.
if they're not too big, the simplest solution would be to use hex-encode it.
check 'blob literals' in http://sqlite.org/lang_expr.html