On Mon, Feb 11, 2013 at 1:45 PM, jose isaias cabrera <cabr...@wrc.xerox.com>wrote:
> > Greetings. > > I have this table, > > CREATE TABLE Test (login primary key, password); > > and I would like to save zlib data using ubyte[] and also call it back in. Are you trying to store zlib-compressed content in the database file, then read back the original uncompressed content? If so, then I suggest adding two application-defined functions compress() and decompress(): UPDATE test SET password=compress(password) WHERE login='test'; SELECT decompress(password) FROM test WHERE login='test'; Sample implementations for the compress() and decompress() functions can be copied from here: http://www.fossil-scm.org/fossil/artifact/a59638aa4c0?ln=53-105 The code for registering these application-defined functions with the SQLite database connection is seen here: http://www.fossil-scm.org/fossil/artifact/a59638aa4c0?ln=119-122 > I have things like this: > 1. To save in SQLite, > cmd = > " UPDATE Test password = " ~ > cast(char[])cast(ubyte[])std.zlib.compress(cast(void[])"password") ~ > " WHERE login = 'test';"; > > This works, or at least, it saves in SQlite, but when I call it back, it > does not. > > 2. To call it in SQLite, > > char[] passWord = > cast(char[])cast(ubyte[])std.zlib.uncompress(cast(void[])r[0]["password"]); > > where r[0]["password"] is what I just SELECTED from SQlite. I am getting > an UTF8 error. This is a D program, so, the syntax may not be known to > some or all of you. However, the more realistic SQLite question would be, > how can I save ubyte data in SQLite and also call it back. Thoughts? > Comments? Jokes? :-) > > thanks. > > josé > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users