-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a custom dialect to change LIMIT
to TOP
#62
Comments
Say I have this:
and then in
This is what is printed:
I should also mention that I am using it like this:
Here is the stack trace from
|
Ok so a workaround I came to was:
But unfortunately
|
Ok the problem was that I was using:
...and then building the query using It seems like with this approach queries may be too tightly bound to the engine. It would be good to be able to create queries and then run them on multiple engines when required. I'm not sure its a real problem though - just too me a while to track down. And I do have a unique use case. |
You can rebind queries with -Stephen On 10 November, 2013 at 10:33:51 PM, Vaughan Rouesnel (notifications@github.com) wrote: Ok the problem was that I was using: g = require 'gesundheit' ...and then building the query using g.select(...). It seems like with this approach queries may be too tightly bound to the engine. It would be good to be able to create queries and then run them on multiple engines when required. — |
Cheers. From the original question: What is the best way to change the order of the |
I think I found it - just have to modify
|
hm, that works, but it's rather ugly. I would definitely be interested in a patch that moves the ordering of Statement child-nodes into BaseDialect. It really does make more sense for the ordering of the output to be controlled by the dialect than the node itself. |
I need to query an
new ActiveXObject("ADODB.Connection")
data source which requires usingTOP
instead ofLIMIT
.select * from table limit 5
becomesselect top 5 from table
.What is the best way to do this from a custom dialect?
The text was updated successfully, but these errors were encountered: