filter not generated properly
const { createFilter } = require('odata-v4-sql');
const filter = createFilter('Id eq 42');
console.log(filter.where) // == '[Id] = ?';
Shouldn't this result in something like '[Id] = 42'? Or am I missing something here?
Hi @AxelUlmestig, if you need this behaviour, then use the createFilter as:
const filter = createFilter('Id eq 42', { useParameters: false });
Also filter.asMsSql() solves this issue.
But there is another problem about generated filter.where part. I use ms sql server and createFilter function generates LCASE function in filter.where query and ms sql server doesn't have LCASE function.
Here is an example about above situation;
'$filter': 'contains(tolower(projectName),'as')', and SELECT * FROM Projects WHERE LCASE([projectName]) like @p0 (Error: 'LCASE' is not a recognized built-in function name)
What I should do to fix that ?