Martin Hoffmann pisze:
Grzegorz Stanislawski wrote:
What i'd like to propose is to allow user
enter its own query string
(as modparam) which would be executed by certain module in certain
situation.
Have you considered using database views? This should give you the
freedom you need in your own database definition and maps it to the
well-known database model for SR.
Keeping such a well-known model adds a layer of dependability. Everyone
who knows SR will be able to query relevant information right away. And
from the view definitions, this person will immediately see how it maps
to your internal data model.
Everyone, even who knows sr, will have to spend few days analyzing
ser.cfg before he knows which information is important and where to find
it, as most data for 'business logic' is stored in avps and those are
named and used according to imagination of original script writer.
Of course that database views and db_schemes can be used to retrieve
important data from virtually any data model, special route blocks can
do some lookups,checks and perform some actions, but sometimes it gets
so complicated that person who have written it can get lost.
Someone might want to use a stored procedure in sql, instead of having
simple select from credentials, which may do some internal checks (if
account is enabled, customer has paid his bill etc) before it returns a
credentials for authentication in ser. Why? because he don't have to
write all that in ser.cfg, or just because his boss prefers this way.
I'm actually concerned that it would be easier to get familiar with
someone else's script when there is fixed number of queries do analyze,
than having to do reverse engineering of views, db_schemes or db_ops
queries scattered all over the script.
Regards,
Martin
Grzegorz Stanislawski