Implement RegFlushKey
Shachar Shemesh
wine-devel at shemesh.biz
Sat Dec 27 09:51:57 CST 2003
Dmitry Timoshkov wrote:
>"Shachar Shemesh" <wine-devel at shemesh.biz> wrote:
>
>
>
>>This is a request to understand, not a suggestion (yet?).
>>Why not use a general purpose DB system? (postgresql, mysql, whatever)
>>After all, the registry is just a tree shaped database. We can do that
>>using standard SQL, and fall back to our current method if a proper DB
>>is not found.
>>
>>
>
>An idea behind current implementation is that everyone can easily fix
>the things in the case of corruption, which is a weak point of MS Windows.
>
>
>
Ok, let's offer that as an option.
The other thing is that, as far as I can tell, the database is awfully
simple. Two tables - one for keys, one for values.
The keys table:
key ID, primary key (serial type in PGsql).
Key name, varchar (or whatever).
Parent key (foreign key to key ID).
unique index on key name (if the database support the collation where
things are case insensitive, which most databases should).
The values table:
Key - foreign key to the Key ID in the keys table
Value name, varchar.
Value type - long int
Value data - binary
Primary index - key+value name (unique).
Alternatively, if you want easier editing of the DB itself, you can
split the data into seperate tables - one for strings, one for numbers,
and one for everything else. I believe this design is still simple
enough for the DB to maintain data integrity even when editing outside
of the scope of Wine, which means you can use the standard DB tools to
fix it if something goes wrong (may require triggers, which are
generally frowned upon these days. Also means that MySQL is out, as it
doesn't have these IIRC).
What you gain - fast, efficient, Unicode aware manipulation. Data
integrity taken care for you. Concurrancy taken care for you. Seems too
good to be true, I think.
--
Shachar Shemesh
Open Source integration & consulting
Home page & resume - http://www.shemesh.biz/
More information about the wine-devel
mailing list