monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] silly question #2: why base64?


From: Christof Petig
Subject: Re: [Monotone-devel] silly question #2: why base64?
Date: Wed, 21 Sep 2005 21:35:05 +0200
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)

Lapo Luchini schrieb:
> Isn't sqlite supposed to be binary-safe?

It is. Since revision 3.

> Well, except from \0, AFAIR, but shouldn't avoiding that be way faster
> and smaller than full base64?
> OK, HDD is cheap, but wasting 1/3 of the space and using a system that
> is designed to be binary safe seems a pity to me =)
> 
> (I see that even text data is put as base64 actualy, so I guess there is
> a reason behind it, but I cannot grasp it ^_^)

The reason is that monotone was designed with sqlite2. To support binary
data you have to use descriptors with sqlite3. The port to sqlite3 was
done in serveral steps, first was a minimal port, second was using
descriptors and step 3 would have been to save data in binary.

And nobody yet has undergone the Task to actually do it. It's on my todo
list since I once started the sqlite3 port but _I_ will not do it until
cvssync is mainline (no, we should not rush that).

Problem 1 is that binary data is ugly to handle on screen or debugging
output. Problem 2 is a transparent migration scheme for the user (that's
not trivial). Problem 3 is to decide which data should get stored binary
(IMHO all base64 encoded, to store IDs in binary is debatable - using
sqlite3 as a debugging aid is not that uncommon). Problem 4 are programs
like monotone-viz which directly access the database ...

> PS: I wonder why the sqlite.org does contain no more a reference to the
> suggested sqlite_encode_binary() it once had and I was remembering
> about... I guess that's because sqlite3 doesn't need it no more and also
> \0 is a valid char, though I cannot find a direct confirmation of it

I cannot point to the documentation, but AFAIK sqlite3 is fully BLOB
capable (binary large object).

  Christof

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]