Re: Need help intercepting SQL

2011-07-11 Thread Eric B
> I am taking a very wild guess, as i have not pored over the docs, > but does a middleware which proxies the sqls help you? I think > i saw one such in djangosnippets. I searched djangosnippets.org for "proxy sql" and only found http://djangosnippets.org/snippets/1913/. That's not exactly what I

Re: Need help intercepting SQL

2011-07-11 Thread Eric B
> @OP: I think your better bet would be to implement your own db > backend, deriving from django's mysql backend. I agree and looked into this, but the backend in Django 1.2 actually defers to the MySQLdb library. I couldn't find any references online that talked about or showed examples for exte

Need help intercepting SQL

2011-07-10 Thread Eric B
Our web site uses Django 1.2. We're adding a layer to our MySQL database called dbShards for fragmentation (sharding). I need to prepend instructive SQL comments (/* ... */) to UPDATE statements in certain situations. What's the best way to intercept the raw SQL sent to the database? I've come