Skip to content
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

Add MySqlDataReader.GetX(string column) #435

Closed
caspChristian opened this issue Feb 8, 2018 · 4 comments
Closed

Add MySqlDataReader.GetX(string column) #435

caspChristian opened this issue Feb 8, 2018 · 4 comments
Assignees

Comments

@caspChristian
Copy link

It seems that only GetX(int ordinal) is implemented while Oracles connector implements string column variants for most if not all of the Get methods. Is there any specific reason for this that I have not been able to find?

@bgrainger bgrainger changed the title Missing GetString(string column) and friends (?) Add MySqlDataReader.GetX(string column) Feb 8, 2018
@bgrainger
Copy link
Member

bgrainger commented Feb 8, 2018

Connector/NET adds GetX(string column) methods (that aren't part of the DbDataReader API). The implementation should be fairly simple:

GetInt16(string name) => GetInt16(GetOrdinal(name));
GetInt32(string name) => GetInt32(GetOrdinal(name));
GetInt64(string name) => GetInt64(GetOrdinal(name));
// etc.

@caspChristian
Copy link
Author

Yep, not hard to implement, just wondered if there was any particular reason for it not to be that I had missed.

So in accordance with "Cloning the full API of Connector/NET is not a goal of this project, although it will try not to be gratuitously incompatible. For common scenarios, this package should be a drop-in replacement." ... this should be nice to have (if anyone are up to implementing it) also as I understands the tags: "enhancement", "up for grabs" ;)

@bgrainger
Copy link
Member

No reason for them not to be implemented; just no one's asked for them before. 😀

(I've never used them; most ORMs seem to use the ordinal-based variants, which would be a little more efficient.)

@bgrainger
Copy link
Member

Added in 0.36.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants