-
Notifications
You must be signed in to change notification settings - Fork 55
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
SQL adapter select queries #214
Comments
Yes, we should definitely fix this. Can you add a failing test for us? Should be fairly simple, this test is a good template. |
The validation process for a number property on a model item should coerce string values to number/int if possible, and add an error to the 'errors' property on the instance if it's not possible. In that case, We have a bunch of tests for this: https://github.com/geddy/model/blob/master/test/unit/datatypes.js#L23 Are you not going through the normal item-creation process? |
Ah, when you say "assigned to that column," are you talking about the filter values in the query object? |
This wasn't in creation of a item; it was in querying for items. Ya I meant a filter value in the query object. I'll put a test together tonight or tomorrow. |
It seems like the SQL adapter doesn't check for types before executing a query. For example, I have a column that is of type 'number', and some data coming in that is assigned to that column isn't a valid number (it is a string 'Normal'). The generated select query trusts that it is a number, and so the generated query has it unquoted. For this case, SQL thinks 'normal' is a column name, doesn't find it, and errors out.
The text was updated successfully, but these errors were encountered: