如何修改ServiceStack.OrmLite生成的SQL? [英] How can I modify the SQL generated by ServiceStack.OrmLite?

查看:123
本文介绍了如何修改ServiceStack.OrmLite生成的SQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ServiceStack的 AWS RedShift . AWS RedShift使用Postgresql Wire协议作为其查询接口,并对可运行的查询施加了一些限制,其中之一是它无法接受参数化查询(有人告诉我;实际上我无法找到此备份在文档中).

I want to use ServiceStack's OrmLite in C# to query AWS RedShift. AWS RedShift uses the postgresql wire protocol as its query interface, and puts some constraints on the queries that can be run, one of which is that it cannot accept parameterised queries (I've been told; I haven't actually been able to find this backed up in documentation yet).

因此,我正在研究是否可能使用ORM生成参数化的SQL,然后在参数值中查找/替换.

So, I am investigating whether it would be possible to use an ORM to generate parameterised SQL, then find/replace in the parameter values.

如何访问OrmLite生成的SQL,然后在运行之前对其进行更改?

How can I get access to the SQL generated by OrmLite to then change it before it is run?

推荐答案

OrmLite(当前)直到执行后才使它生成的SQL可用.

OrmLite doesn't (currently) make the SQL that it will generate available until after it has been executed.

我发现RedShift实际上支持参数化查询.

I discovered that RedShift does in fact support parameterised queries.

这篇关于如何修改ServiceStack.OrmLite生成的SQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆