hmm, I realize now that naming the base db "refdb" is arbitrary. I guess
a user could choose during install to call the base database "mybasedb"
or whatever, and then could create another database called "refdb", and
have references added to that.
Maybe I could make it configurable through a variable named
say, refdb-base-database. (In addition to the current
refdb-listdb-sql-regexp variable).
The code would take the list of databases that listdb returns, check it
against refdb-base-database, and remove any whatever name matches. I
could make "refdb" the default, and document it by saying:
Set this to whatever name you gave to the base RefDB database during
installation (that is, using 'mysql -e "CREATE DATABASE refdb1"' or
the PostgreSQL "createdb" command).
Or to make it more configurable, we could add refdb-listdb-ignore-list
variable, again with default value "refdb", but make it a list. Users
could put multiple names into it that way, and then wouldn't need to
mess around with trying to figure out how to construct a regex and
express it in whatever syntax their backend database supported.
And that way, we could also include the built-in database names for the
backends -- i.e. Postgres's "template0" and "template1" databases, and
whatever the names are of the built-in databases that MySQL sets up.
How does that sound?
Now that I write all that, though, I wonder whether that logic might not
be better handled on the RefDB side -- so that refdbd -C listdb wouldn't
return the name of the base RefDB database, whatever its name, or of the
built-in backend database names.
--Mike
Michael Smith <smith@xxxxxxxxxxx> writes:
> Markus Hoenicka <markus.hoenicka@xxxxxxxxxxxx> writes:
>
> > Bruce D'Arcus writes:
> > >
> > > Question:
> > >
> > > Should the base db (now called "refdb") be included in the list of dbs
> > > in the menu?
> > >
> >
> > I'm not sure how to handle this intelligently. In a shared environment
> > you'll always face the problem that your database engine hosts a
> > variety of databases that do not belong to RefDB. You should exclude
> > these as well. The only way that I can think of is to stick to a
> > name pattern for RefDB databases and run listdb with an appropriate
> > regexp. Maybe the menu code can use a regexp if one is set in .emacs?
>
> Yes -- it actually already have the refdb-listdb-sql-regexp variable in
> there already to support just that. The default for it is "%".
>
> But as far as the base db named "refdb" goes, users should never be
> directly adding any data to that via refdbc -C addref or whatever,
> right? If so, then I will have the code not add it to the menu.
>
> --Mike
--
Michael Smith
Openwave Systems Japan +81 90 9148 0269 (mobile)
Nishishinjuku 6-22-1 +81 3 5909 6347 (office)
Tokyo, Japan 163-1117 +81 3 5909 6241 (fax)
pgpZBt5xZq7mk.pgp
Description: PGP signature
|