是否有处理 SQL 限制和事务的 DBI 代理?
我正在寻找同时支持 SQL 限制和事务的 DBI(或类似)代理。 我知道的两个是:
DBD::Proxy
DBD::Gofer
DBD::Proxy
我在 DBD::Proxy
中发现的问题是它的服务器 DBI::ProxyServer 不仅限制通过网络传入的查询(这是我想要的),而且还限制由数据库驱动程序。 因此,例如,使用 DBD::Oracle
时,ping 以及它自身发出的许多其他查询都不再有效。
我不能只是允许它们,因为:
- 这是 DBD::Oracle 的相当多的内部知识,并且非常脆弱。
- 白名单是
query_name => 'sql'
,其中query_name
是传递给prepare
的第一个单词。 DBD::Oracle 有很多内部查询,其中许多查询的第一个词是select
(废话)。
所以,我似乎不能使用 DBD::Proxy
DBD::Gofer
我还没有尝试过 DBD::Gofer,因为文档似乎告诉我,我不能通过以下方式使用事务它:
约束
...
您不能使用交易
仅限自动提交。 不支持交易。
那么,在我编写自己的特定于应用程序的代理(使用 RPC::PLServer ?)之前,是否有代码可以解决这个问题?
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'
, wherequery_name
is the first word of whatever is passed toprepare
. DBD::Oracle has a lot of internal queries, and the first word of many of them isselect
(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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题最好在 DBI 用户邮件列表上询问,
[email protected]
。在 http://dbi.perl.org/ 注册
我不确定您对 DBD 的意思::代理限制查询。 我唯一一次使用它时,它根本没有修改查询。
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.