DBIx::Class - 添加对“立即更新”支持的最佳方式;
我想添加对“FOR UPDATE NOWAIT”的支持,以使用 ->select(..., { for => 'update_nowait' })
(对于 Oracle)选择语句。
我正在使用 DBIx::Class 0.08127
我可以修改 DBIx/Class/SQLMaker/Oracle.pm,但我想知道是否还有另一种(首选)方法,特别是如果它不涉及修改分发文件。
I want to add support for "FOR UPDATE NOWAIT" to select statements with ->select(..., { for => 'update_nowait' })
(for Oracle).
I'm using DBIx::Class 0.08127
I can modify DBIx/Class/SQLMaker/Oracle.pm, but I was wondering if there is another (preferred) way, especially if it doesn't involve modifying distribution files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修改
DBix::Class::SQLMaker::Oracle
是我的做法。只需将修改后的模块包含在
@INC
中包含 DBIx 类发行版的目录之前的目录中即可。对 DBIx/Class/SQLMaker/Oracle.pm 的修改是添加以下行:
现在,如果
$for_syntax
是方法调用而不是词法,则无需重复的定义_lock_select
。如果您想提交补丁,需要考虑一些事情。Modifying
DBix::Class::SQLMaker::Oracle
is the way I've done it.Just include your modified module in a directory that occurs before the directory containing the DBIx Class distribution in
@INC
.The modification to DBIx/Class/SQLMaker/Oracle.pm is to add these lines:
Now if
$for_syntax
were a method call instead of a lexical you wouldn't have to repeat the definition of_lock_select
. Something to consider if you want to submit a patch.