Open omayhemo opened 8 years ago
@omayhemo with milestones you can essentially do whatever you want, can you be more specific?
We have a very complex query, with wildcards. In our query we need to be able to use the sql underscore wild card.
https://msdn.microsoft.com/en-us/library/ms179859.aspx
Thus far, I haven't found a way to do that through the normal epilogue criteria filter. My first inclination is to use sequalize raw queries.
http://docs.sequelizejs.com/en/latest/docs/raw-queries/
If it's possible to filter in this manner without gaining direct access to sequelize (through epilogue), I'm very happy to implement it that way. Failing that option, I need to handle the query explicitly.
@omayhemo maybe this tip would help you: https://github.com/dchester/epilogue/issues/167#issuecomment-223343235 ?
Thanks for your response. Given that I hook into before list fetch and add the raw:true option to context.options, where then do I pass the raw sql, on the criteria?
oh right I see what you're saying. no, presently we don't have any way of setting some sort of option to execute a sequelize.query("raw data in here")
. You have two options:
Create
is write
), put your query into that milestone and then skip the rest of the action.The first option is the most flexible choice. If you'd like to experiment with the latter option we would need more information, maybe even a model definition and an example of what kinds of output you're looking for.
So I can't cast raw sequel to the context.query ? What is the raw option for, then?
And what do you mean skip the rest of the action? Can you give me an example?
no, in fact I don't believe context.query
is a thing.
according to do the docs, the raw option does the following:
[options.raw=false] Boolean If set to true, values will ignore field and virtual setters.
for building, and:
[options.raw] Boolean Return raw result. See sequelize.query for more information.
for querying
Is it possible to use the raw sql options built into sequelize, through epilogue?