-
Notifications
You must be signed in to change notification settings - Fork 463
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
Custom data type handlers #1170
Comments
At the moment there's no way to customise the parsed type. This would be a nice feature to add (custom typing or type resolution); the basis of it is there as we run the rows through "value correction" node-mssql/lib/tedious/request.js Lines 161 to 171 in 5923bba
But this isn't extensible at the moment. |
@dhensby Thanks for the quick response. Glad to hear it's prepared in a good way! I would happily attempt working on a PR for this, if you'd be willing to guide me a bit. How would you want this to be configured? How would one register value correction handlers for a certain type? |
I'm loading
DATE
,DATETIME
andDATETIMEOFFSET(3)
from my SQL server database. I've only testedDATETIME
withnode-mssql
so far, but it looks like it's parsed into a native JavaScriptDate
, which makes sense. However, I would want to change this so that...:DATE
(sql.Date
) intojs-joda
sLocalDate
DATETIME
(sql.DateTime
) intojs-joda
'sLocalDateTime
DATETIMEOFFSET(x)
(sql.DateTimeOffset [scale]
) intojs-joda
'sZonedDateTime
Is there a way to register custom handlers for these types?
The text was updated successfully, but these errors were encountered: