(RADIATOR) Fwd: Dynamic DBSource
Oscar L. Garzón
ogarzon at andinet.com
Wed Jan 29 10:53:41 CST 2003
I Added %R.tablename in my SQL statements and it's working wonderful, I can
handle username in a easier way, thanks a lot...
Now I have another question, is there a way to use Client-Identifier as a
variable, I mean %{Client-Identifier}, directly in the SQL Statements? for
example,
AuthSelect SELECT USERNAME, PASSWORD FROM USER WHERE
NASPROFILE="%{Client-Identifier}"
or what would be the best way to implement this, I guess if it's not
trivial, I need a hook, but examples in the goodies/hooks.txt file aren't
still clear enough for me.
Thanks in advance,
OSCAR
> >What would be the best way to implement dynamic dbsource specifications
> >based on run-time variables, what I actually need is what the following
> >sentence says, but as you my guess, the do not work because sql
> >connections are handled at startup. ( %R would be realm )
> >
> >DBSource DBI:Pg:dbname=%R
> >DBUsername %R
Not sure I can help you if you need a different user/server, but logging
to different databases on the same system should be fairly trivial; simply
construct your SQL statements as UPDATE %R.tablename SET ... or similar.
If you need to be using different logins entirely, possibly some sort of
proxying system would be your best answer (there's a DBI-based one you
might be able to use since you're running Perl already) - so a single
apparent login and db server to Radiator becomes multiple on the other
side.
I don't think you'd really want to do this otherwise anyway, since setting
up and tearing down your database connection every time you have a hit is
horrifically expensive - probably more so than the proxying solution
described above.
OR - the unpleasant but ultimately perhaps the simplest way - knock up a
quick script that generates a separate clause for each potential Realm.
- Matt S Trout
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
-
OSCAR LEONARDO GARZON. [ ogarzon at andinet.com <mailto:ogarzon at andinet.com> ]
Andinet on Line - División de Proyectos Especiales
Tel. +57(1)6004330. Fax. +57(1)6004370
http://www.andinet.com <http://www.andinet.com> .
Bogotá, Colombia
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list