From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dirk Bergstrom To: 'Peter Novodvorsky' , gnats-devel@sources.redhat.com Subject: RE: modular database backends Date: Tue, 29 May 2001 00:11:00 -0000 Message-id: X-SW-Source: 2001-q2/msg00119.html a database backend for gnats, huh? i've been thinking about this myself. in fact, it's quite likely to be a major project for me this year. i haven't gotten too far along, but i will soon have a lot more time to devote to thinking about it. i wouldn't describe myself as a high powered C programmer (cough cough...), but i've got clue, time, and energy. we should gather together interested parties, and kick some ideas around. -- Dirk Bergstrom dirk@juniper.net ____________________________________________ Juniper Networks Inc., Engineering Web Guru Tel: 408.745.3182 Fax: 408.745.8905 > -----Original Message----- > From: Peter Novodvorsky [ mailto:nidd@altlinux.ru ] > Sent: Sunday, May 27, 2001 11:18 AM > To: gnats-devel@sources.redhat.com > Subject: modular database backends > > > > Hello! > > I always thought about BTS as database and tools to work with > it. And these things are different. In gnats I see opposite > thing: database, > tools and servers share one source and tools sometimes do too much. > > So I've began work on making database backends to > gnats modular. > Just now, gnats has two "backends", network (gnatsd) and filsystem. If > we make system of backends modular we could have SQL backend, > etc., etc. > > Second thing I don't like in GNATS, it doesn't has ACLs. This > modular framework should support them. Here is the header file that > will briefly describe what I mean: > > struct _gnats_database { > URI *U; > > FILE *serv_read; > FILE *serv_write; > > void *module_handle; > > int (* init) (ErrorDesc *err, gnats_database); > int (* add_pr) (ErrorDesc *err, gnats_database, PR); > int (* update_pr) (ErrorDesc *err, gnats_database, PR); > int (* query_pr) (ErrorDesc *err, gnats_database, QueryExpr); > int (* disconnect) (ErrorDesc *err, gnats_database); > }; > > typedef struct _gnats_database *gnats_database; > > gnats_database gnats_new_database (ErrorDesc *err, URI *U); > int gnats_destroy_database (gnats_database db); > > module_handle is object handle that is returned by dlopen. > URI is: > > struct _URI > { > char *scheme; > char *host; > char *user; > char *pwd; > char *path; > unsigned int port; > }; > > typedef struct _URI URI; > > And there is a function > > URI *gnats_parse_uri (const char *gnats_uri, int length); > > that takes URI (for example > gnatsd4x://nidd:pwd@nidd.debian.net:1529/database_name) and converts > it in such structure (gnatsd4x is 4.0 gnatsd protocol). > > I'm currently implementing gnatsd4x backend. After this I'll > make query-pr, pr-edit, gnatsd and other tools to work with > this model. > And then I'll begin to make SQL backend. > > If everything will be OK in the end following will be > possible: > > user -> client -> gnatsd -> SQL server (MySQL, Postgres) > > What do you think of this crazy idea? > > Thanks, > -- > Peter Novodvorsky http://www.altlinux.ru/ AltLinux Team, Russia > Debian.Org http://debian.org/~nidd Debian --- no need to wait for tomorrow.