isValidIdent method question
rojoyin opened this issue · 2 comments
rojoyin commented
Hello,
I am sending this json
{
"$select": {
"$columns": ["day", "firstname", "lastname"],
"$from": "a.b.1"
}
}As a result I got:
{
"sql": "SELECT day, firstname, lastname FROM a.b.\"1\"",
"values": []
}What I was expecting was:
{
"sql": "SELECT day, firstname, lastname FROM a.b.1",
"values": []
}The point in the code that changes what I expected is in the following validation.
json-sql-builder2/lib/builder.js
Lines 129 to 131 in d0944e6
Is there any reason the identifier must not begin with numbers?
I could fix it, if there is no problem in changing this condition.
Best regards.
planetarydev commented
My major System is postgres and there it is Not allowed. You can fix it in condition to the specific System you need. Or a netter way is to implement an option for that.
rojoyin commented
I solved by using the function setQuoteChar passing the parameter with value ''
Thank you