Re: [Vala] Problems retrieving binary data from a sqlite3 database BLOB column


On 27 June 2011 08:21, Alexandre Rosenfeld
<alexandre rosenfeld gmail com> wrote:
Just summarizing what Alexey said, what you need is:

var data = (uint8[]) stmt.column_blob(4);
data.length = stmt.column_bytes(4);

You first get the data from Sqlite and then tell Vala about it's length. The
thing here is that Sqlite's API is not exactly Vala friendly, so you have to
do a bit more work then you usually need with Vala.

Alexandre Rosenfeld

This doesn't work, crashing at the same place:
var data = (uint8[]) stmt.column_blob(4);
#2  0x0000000000402643 in _vala_array_dup3 (self=0x628d88
"\211PNG\r\n\032\n", length=-1) at /home/inigo/tmp/2-nodb/nodb.c:352
as at this point we don't know data length.


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