[erlang-questions] More natural interface for SQLite wrapper

Alexey Romanov alexey.v.romanov@REDACTED
Mon Nov 22 15:19:56 CET 2010


On Mon, Nov 22, 2010 at 5:00 PM, Bob Ippolito <bob@REDACTED> wrote:
> Does there need to be a difference? Can you use binary for either
> without a tuple tag?

Probably not. I have to call different functions on C side for blobs and text.

> Maybe blob if it's not strictly valid UTF8?

That's possible, but there still needs to be a way to pass a blob
which would be valid UTF8. Plus having to check validity for every
binary would hurt performance...

Yours, Alexey Romanov




> On Monday, November 22, 2010, Alexey Romanov <alexey.v.romanov@REDACTED> wrote:
>> I am working on my fork of the Erlang wrapper for SQLite 3
>> (https://github.com/alexeyr/erlang-sqlite3) and one this question
>> arose: which Erlang values should correspond to SQLite types
>> (http://www.sqlite.org/datatype3.html) TEXT and BLOB? Currently TEXT
>> is any iodata (i.e. binary or iolist), and BLOB is represented by
>> tuple {blob, Binary}. The alternative would be to allow only iolists
>> as TEXT, and represent blobs as binaries. Which would be easier to
>> use, in your opinion?
>>
>> Yours, Alexey Romanov
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>>
>


More information about the erlang-questions mailing list