[Top][All Lists]

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

Re: modular database backends

From: Bob Kaehms
Subject: Re: modular database backends
Date: Tue, 29 May 2001 07:22:14 GMT

Just as a thought, perhaps the whole thing should be done in php/mysql.
it's a little archaic as is.
Dirk Bergstrom writes:
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              address@hidden
Juniper Networks Inc.,  Engineering Web Guru
Tel: 408.745.3182 Fax: 408.745.8905

-----Original Message-----
From: Peter Novodvorsky [mailto:address@hidden
Sent: Sunday, May 27, 2001 11:18 AM
To: address@hidden
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:address@hidden: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?
Peter Novodvorsky    AltLinux Team, Russia
            Debian  ---  no need to  wait for tomorrow.

reply via email to

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