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
Overhaul type parsers #6473
Comments
@janmeier How are data type parsers set in tedious and sqlite? I would really like to make Raw queries would return the raw values from the library of course. |
sqlite https://github.com/sequelize/sequelize/blob/master/lib/dialects/sqlite/query.js#L167-L181 I definitely see the benefits of tying the data type parse directly to models, since we would be able to do a lot more. I do however think it might be a problem if we don't also hook into raw queries. For example, dates are not even date objects in sqlite by default.
I definitely agree that a type system tie up to models would be more powerful though. And if we provide the option of passing the model to a raw query and using the type parsers from the, it might be a good compromise |
Yes, we need to take raw queries into account. But |
Currently raw inserts are handled by sql-string - As you've seen we already call out to datatypes a couple of places from there |
I guess it's fine as long as we have
For the postgres parsers I propose we just leave them at the default and then call our parsers on top of it. |
Sounds good to me :) |
nice, if you take these, I will do the custom type parsers. |
Prerequisite for #6290
@janmeier Can you do this? I think it's your code
Library support:
The benefit of query-level type parsers are that
parse()
can be an instance method of the data type.The text was updated successfully, but these errors were encountered: