Re: Need help intercepting SQL

2011-07-11 Thread bruno desthuilliers
On 11 juil, 16:47, Eric B wrote: > > @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. Of course it does - MySQLdb is the "offi

Re: Need help intercepting SQL

2011-07-11 Thread DrBloodmoney
I think that you would probably have better luck coming at it from the other end. That is, in the database itself (stored procedure or otherwise). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@

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

Re: Need help intercepting SQL

2011-07-11 Thread bruno desthuilliers
On Jul 11, 4:22 am, Venkatraman S wrote: > 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. Middlewares are only used in the request/response cycle. Not the right place for db-lev

Re: Need help intercepting SQL

2011-07-11 Thread Kirill Spitsin
On Sun, Jul 10, 2011 at 02:41:59PM -0700, Eric B wrote: > 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 bes

Re: Need help intercepting SQL

2011-07-10 Thread Venkatraman S
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. -V -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send em

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