Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add the GetColumnSchema API to SqlDataReader - #6097

Merged
saurabh500 merged 2 commits into
dotnet:masterfrom
saurabh500:sqldbcolumnschema
Mar 2, 2016
Merged

saurabh500 merged 2 commits into
dotnet:masterfrom
saurabh500:sqldbcolumnschema

Conversation

@saurabh500

Copy link
Copy Markdown
Contributor

The change contains the implementation of IDbDolumnSchemaGenerator on SqlDataReader to get the columns as the API to retrieve the Columns metadata.

This change contains the reference to System.Data.Common via the Project Reference in csproj
Sending this PR out for Code Review and this will be complete with another commit to remove the Project Reference once System.Data.Common Nuget packages are updated.

@saurabh500

Copy link
Copy Markdown
Contributor Author

@kkurni @corivera PTAL

{
return _metaData.dbColumnSchema;
}
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should an empty collection be returned instead of null? It's not usually a good practice to return null from a collection member.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is zero-length ever possible as the "real" result, and if so is a consumer ever likely to care to distinguish that from not-available? (I can't think of how it might be zero-length, but maybe there's a way I'm not considering).

@saurabh500

Copy link
Copy Markdown
Contributor Author

@justinvp Thanks for the review. I will take care of your comments.

@saurabh500

Copy link
Copy Markdown
Contributor Author

The tests are failing because of the new types exposed in System.Data.Common not being accessible via the packaged assemblies.
I will update the changes when the newer version of System.Data.Common

private CommandBehavior _commandBehavior;

private static int s_objectTypeCount; // Bid counter
private static ReadOnlyCollection<DbColumn> s_emptySchema = new ReadOnlyCollection<DbColumn>(new DbColumn[0]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.Empty<DbColumn>()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, readonly

@kkurni

kkurni commented Feb 16, 2016

Copy link
Copy Markdown
Contributor

LGTM

@saurabh500

Copy link
Copy Markdown
Contributor Author

@stephentoub the tests will fail. I am waiting for a nightly build of data common to be able to fix this.

@stephentoub

Copy link
Copy Markdown
Member

Ah, ok :) I saw lots of read and kicked it thinking it may have been due to all the outages yesterday.

@saurabh500

Copy link
Copy Markdown
Contributor Author

@dotnet-bot test this please

@saurabh500

Copy link
Copy Markdown
Contributor Author

@stephentoub This PR is stuck. I submitted an update last night and also sometime ago, however the build is not kicking in.

Is there something I can do? Or should I create a new PR with these changes

@saurabh500

Copy link
Copy Markdown
Contributor Author

@stephentoub For some reason, the CI thinks that there are no changes in this PR. !!

@stephentoub

Copy link
Copy Markdown
Member

It's working now after I closed and reopened, right?

@saurabh500

Copy link
Copy Markdown
Contributor Author

Yes now I see progress in the CI.
The details page says No changes which confused me.
Thanks.

saurabh500 added a commit that referenced this pull request Mar 2, 2016
Add the GetColumnSchema API to SqlDataReader
@saurabh500
saurabh500 merged commit d98dc1d into dotnet:master Mar 2, 2016
@saurabh500
saurabh500 deleted the sqldbcolumnschema branch March 2, 2016 23:52
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Add the GetColumnSchema API to SqlDataReader

Commit migrated from dotnet/corefx@d98dc1d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants