views:

168

answers:

1

I am looking for a DBI (or similar) proxy that supports both SQL restrictions and transactions. The two I know about are:

  • DBD::Proxy
  • DBD::Gofer

DBD::Proxy

The problem I have found with DBD::Proxy is that its server, DBI::ProxyServer, doesn't just restrict queries coming in over the network (which I want), but it also restricts queries generated internally by the database driver. So, for example, with DBD::Oracle, ping no longer works, as well as many other queries it issues itself.

I can't just allow them, because:

  • That is quite a bit of internal knowledge of DBD::Oracle and would be quite fragile.
  • The whitelist is query_name => 'sql', where query_name is the first word of whatever is passed to prepare. DBD::Oracle has a lot of internal queries, and the first word of many of them is select (duh).

So, it doesn't seem I can use DBD::Proxy

DBD::Gofer

I haven't tried DBD::Gofer, because the docs seem to tell me that I can't use transactions through it:

CONSTRAINTS

...

You can’t use transactions

AutoCommit only. Transactions aren’t supported.

So, before I write my own application-specific proxy (using RPC::PLServer ?), is there code out there that solves this problem?

A: 

This question would be best asked on the DBI Users mailing list, [email protected]. Sign up at http://dbi.perl.org/

I'm not sure what you mean about DBD::Proxy restricting queries. On the only occasion I've used it, it didn't modify the queries at all.

Jonathan Leffler
Look for 'restrict' in the DBI::ProxyServer POD. That'll explain SQL restrictions. I think the answer is "there isn't one". I wrote my app-specific one. But I'll pick this as the answer anyway.
derobert