[development] db_rewrite_sql

Doug Green douggreen at douggreenconsulting.com
Wed Apr 18 12:27:23 UTC 2007


+1 on rethinking this.

I was unable to use db_rewrite_sql for a views add-on because what I really
needed was some information about the view being modified.

I'm not sure if (a) db_rewrite_sql is broken or (b) it could just be used
better.

Having just reviewed the uses of db_rewrite_sql, it seems that the final
argument $args to db_rewrite_sql is never used (at least by core).  I can
only presume that this argument was meant to provide module specific
context.  But no modules are using it.  If this was used more often, then a
hook_db_rewrite_sql implementation would have some context.

I don't have a proposal, but would like to see this discussion for 6.x.

I couldn't find the original proposal and discussion.  Can anyone point me
to it?

Thanks!

Doug Green
904-583-3342
www.douggreenconsulting.com
 
Bringing Ideas to Life with Software Artistry and Invention...
Providing open source software political solutions

-----Original Message-----
From: development-bounces at drupal.org [mailto:development-bounces at drupal.org]
On Behalf Of Moshe Weitzman
Sent: Tuesday, April 17, 2007 9:39 PM
To: development at drupal.org
Subject: Re: [development] db_rewrite_sql

> I know I have participated in a discussion like this before, but 
> couldn't find the issue. So here it is again: What about passing a 
> unique identifier along with every call of db_rewrite_sql? Instead of 
> just wrapping db_rewrite_sql() we could also pass $module and $key so we 
> have accurate namespaces for each query. (Or, we could just do it like 
> hook_mail_alter(), but I think there could be namespace conflicts if a 
> module named foo_module's foo_module_key screws with a module named 
> foo's foo_module_key :P)

this was proposed in the original db_rewrite_sql() but didn't get in. We 
called them query hints or somesuch ... We had enough to chew on at that 
time. It is time to try again, as you propose.



More information about the development mailing list