bug-anubis
[Top][All Lists]
Advanced

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

Re: [bug-anubis] database access with 3,9,95 - feature request


From: Jim Cheetham
Subject: Re: [bug-anubis] database access with 3,9,95 - feature request
Date: Mon, 13 Sep 2004 17:31:14 +1200

On Mon, 2004-09-13 at 15:28, Jim Cheetham wrote:
> I'm querying a MySQL database for the user database, and things (now)
> work fine.
> 
> Unfortunately, while extending my database schema to deal with all sorts
> of interesting things, I want to normalise some of the fields Anubis
> would like to see into separate tables.
> 
> Because I'm using MySQL, I can't construct a view (only available in
> v5+, which is in alpha) that would provide a virtual table.
> 
> I can quite easily provide the table that Anubis would like to see as
> the result of a query, however ...
> 
> The sort of query would be :-
> 
> SELECT concat(lhs,'@',domain) AS authid,
>        password_plain AS passwd,
>        uname AS account,
>        anubisrc AS rcfile
> FROM email_auth
>       NATURAL JOIN email_address
>       NATURAL JOIN domain
>       NATURAL JOIN sysaccount
> 
> So, can I request consideration of a new database URL parameter, query,
> which defaults to 'SELECT * from users' ?

Or, after a quick and unsuccessful hack with the source, three options ...

selectquery = "SELECT %s,%s,%s,%s FROM %s WHERE %s='%s'"
listquery = "SELECT %s,%s,%s,%s FROM %s"
insertquery = "INSERT INTO %s (%s,%s,%s,%s) VALUES ('%s','%s','%s','%s')"

:-)

This might require some changes to the config file parser, to permit
parameters with spaces to be quoted somehow?

-jim





reply via email to

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