Conversation
MS SQL doesn't support RegExps, so the idea was to have opportunity to have "like" options for odata functions contains, startswith and endswith.
|
Thank you for your effort. I'm trying to remember this repository. :) Wouldn't it be better to try to support regexp at least partially? function eq (q, table, el, obj, op, type) {
if (obj instanceof RegExp) {
var pattern = obj + ''
return q[op](table[el].like('%' + pattern.substring(1, pattern.length - 1) + '%'))
}
if (type.isPrimitive) {
return q[op](table[el].equals(obj))
} else {
return q[op](table[el].like('%' + obj + '%'))
}
}This would make many common queries working |
|
Hello, thanks for your answer! |
|
Yes, maybe it could be improved to support it and use |
|
I understand it never will support it... let's try at least 👍 update: may be it's easier to convert to RegExp later on DB specific layer? at least there will be no need to parse it back BR, |
just a type added
MS SQL doesn't support RegExps, so the idea was to have opportunity to have "like" options for odata functions contains, startswith and endswith.