-
Notifications
You must be signed in to change notification settings - Fork 78
Support number as field name #5
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
Conversation
Anyone who to handle this PR? |
@@ -23,6 +23,10 @@ SqlString.escapeId = function escapeId(val, forbidQualified) { | |||
return sql; | |||
} | |||
|
|||
if(typeof val === 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style
Is there any document talk about filed name can be a number? |
@fengmk2 cnpm's model layer https://github.com/cnpm/cnpmjs.org/blob/master/models/download_total.js uses And I tried to use It created successfully. |
Sorry, apparently I never actually subscribed to this repository :) I don't see anything wrong with the concept, but I have a few comments on the change itself:
|
For the first point, I don't think someone will expect For the second one, I will commit later to declare a new variable. |
…ad of reassigning it to an argument
Sure, I tend to agree, but i.m.o that same argument would just be instead of even making this PR, just pass the number as a string in the first place... :) |
@dougwilson e.g. for (let i = 0; i < 10; i++) {
escapeId(i);
} Code above will crashed without this PR. But it's more convenient. Or the code should be like: for (let i = 0; i < 10; i++) {
escapeId(i.toString());
} |
E.g.
And my code would be like: