You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
columnMetadata type.name not listed in TYPES #1050
And TYPES.IntN is undefined. All types listed in TYPES have a similar interface to the columnMetadata.type, but it seems it does not contain all types that are being exposed to me.
After some further investigation, I accidentally found that an older version of Tedious had many more types available on TYPES, and the problem I'm describing would not have occurred.
There must be a reason these types were removed from TYPES, and so there must be some kind of upgrade path for me.
My use-case is that I'm doing runtime type checking in parts of my code, and I verify that any type names going through my database driver are acknowledged in the TYPES enum, and my code now raises warnings about the type names returned in query results.
This removes the following, long deprecated parameter types: [...] IntN [...]
So seeing as they've been long deprecated, and actually removed some major versions ago, my new question becomes: Why am I still seeing them returned in query results?
This hints to the reason for deletion from TYPES: You don't want users to access them directly.
For my own use-case this is a little problematic, because it means I can't nicely model TypeName for runtime type checking by simply taking the keys of TYPES as enums.
Is there another way to obtain all possible types that might be exposed to users?
@Avaq Types like IntN are a detail of the TDS protocol, and there's no reason a user would ever need to know about it. It always maps to a "concrete" type like tinyint, smallint, int or bigint. Unfortunately, as you encountered, we don't actually map IntN back to one of these proper types, and expose this internal detail to users.
#1031 would fix this, and I'll see if we can get it merged sooner rather than later to solve this issue for you and others.
Thank you for the replies! I honestly had a look around before I created this issue, but did not notice #886 before. Perhaps I should close this as a duplicate?
Activity
[-]responseMeta type.name not listed in TYPES[/-][+]columnMetadata type.name not listed in TYPES[/+]Avaq commentedon Feb 19, 2020
Scrolling through the release notes, I found release 6.0.0: https://github.com/tediousjs/tedious/releases/tag/v6.0.0
So seeing as they've been long deprecated, and actually removed some major versions ago, my new question becomes: Why am I still seeing them returned in query results?
Avaq commentedon Feb 19, 2020
In the removal commit I found the following comment:
This hints to the reason for deletion from TYPES: You don't want users to access them directly.
For my own use-case this is a little problematic, because it means I can't nicely model
TypeNamefor runtime type checking by simply taking the keys of TYPES as enums.Is there another way to obtain all possible types that might be exposed to users?
IanChokS commentedon Feb 19, 2020
I think I have a PR that addresses this issue #1031. I'll update the PR. @arthurschreiber should we move forward with this?
arthurschreiber commentedon Feb 19, 2020
@Avaq Types like
IntNare a detail of the TDS protocol, and there's no reason a user would ever need to know about it. It always maps to a "concrete" type liketinyint,smallint,intorbigint. Unfortunately, as you encountered, we don't actually mapIntNback to one of these proper types, and expose this internal detail to users.#1031 would fix this, and I'll see if we can get it merged sooner rather than later to solve this issue for you and others.
Avaq commentedon Feb 19, 2020
Thank you for the replies! I honestly had a look around before I created this issue, but did not notice #886 before. Perhaps I should close this as a duplicate?
IanChokS commentedon Feb 19, 2020
I think its fine if we can keep this open until the PR gets merged.