sqlite file format, anyone?

Derek Atkins warlord at MIT.EDU
Sun Jun 22 01:35:07 CDT 2003


Matthew Vanecek <mevanecek at yahoo.com> writes:

> > Ok, call me stupid, but why would one need to access "system tables"?
> > 
> 
> To find out, for instance, if a table named "gncVersion" exists in the
> current database.  They're most useful for front ends such as pgaccess,
> but do come in handy in other situations (e.g., checking if your apps
> tables exist in the current database prior to trying to access them).

Perhaps it's late or I'm tired, but I still don't see why that
matters.  Why can't you just try to access the table and check for an
error if it doesn't exist?  Will some databases automatically create
the table for you or something?  Or perhaps some databases don't
differentiate between 'table does not exist' and 'table has no
contents'?

> > I'm trying to figure out when we need to go backwards....
> 
> It's just a referential integrity thing ingrained in most database
> programmers...

*shrugs*  So add a table name in addition to the guid.  :)

> > Ok, what do you register for?  Do you register for a particular row
> > in a table?  Or register for a table?  Or register for something else?
> 
> Any application registers by executing the LISTEN SQL command on a given
> "name".  An updating application would execute the 'NOTIFY "name"' SQL. 
> The listener receives the event via the PQconsumeInput()/PQnotifies()
> method.  A robust application would probably have a separate thread
> waiting for events using the select() or pselect() (man 2) function. 
> That way events could be continuously received and appropriate signals
> dispatched, etc.

Ok, so it's basically done on "arbitrary string" which sounds like
you could do it at any level you want (provided there isn't a limit
on the number of "LISTEN" sql queries that any one client can make).

> > I know that SQLite doesn't have this.  I don't know if MySQL does.

MySQL does not appear to have a LISTEN or NOTIFY command.

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list