GUIDs (was Re: SQL backend for GnuCash 2)
Phil Longstaff
plongstaff at rogers.com
Fri Oct 27 12:59:48 EDT 2006
On Fri, 2006-27-10 at 12:33 -0400, Derek Atkins wrote:
> Quoting Phil Longstaff <plongstaff at rogers.com>:
>
> >> I still don't understand why you want to do this. What does it buy
> >> us? It seems to add a LOT of complexity on the GnuCash side when
> >> building up SQL queries. Instead of just being able to print out
> >> "$table.${object}_id='$guid'" we'd need a much more complicated SQL
> >> generator routine.
> >
> > I'm changing this to char(16). I'm still concerned about 0x00 in a
> > GUID. The SQLite documentation says that memcmp is used to compare char
> > strings, so that is OK, but I don't know about other db's. MySQL
> > supports binary(16), but other db's may not.
>
> Make it "char(32)" and use the ascii hex-string representation.
OK
> > Since the connection string will be db-specific, we may want a db core
> > built around libgda (see libgda vs libdbi e-mail) with a small add-on to
> > handle the connection string formatting and how guid's will be handled
> > (as well as adding db-specific indexes, stored procedures, ...).
>
> Hmm.. I dont know how that might work.. But maybe that's because I
> don't know GDA well enough.
Well, with libgda, you can make a connection in 2 ways. The first is to
call an API and pass a pre-defined dataset name (dsn) which contains the
provider name, connection string, and other info needed. This
predefined dsn is a section in ~/.libgda/config. The other way is to
call a different API and pass the provider name and connection string.
The connection strings are similar but will contain different info. An
sqlite connection string should contain a file name, while a mysql or
pgsql string should contain a host name, port number and database name.
Phil
More information about the gnucash-devel
mailing list