Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request implements the GetSchema method in SpannerConnection to expose common ADO.NET metadata collections such as MetaDataCollections, DataSourceInformation, DataTypes, Restrictions, and ReservedWords, along with corresponding unit tests. The review feedback correctly points out that, according to the ADO.NET specification, the collectionName parameter must be case-insensitive. Additionally, since none of the supported collections allow restrictions, the implementation should throw an ArgumentException if any restrictionValues are provided. The unit tests should also be expanded to verify this case-insensitivity and the exception behavior, including asserting on the exception message.
e55bb9c to
f697ee7
Compare
f697ee7 to
6bff0f4
Compare
…connection behavior
…nd unique type best matches
Summary
Implement the common ADO.NET
DbConnection.GetSchemacollections and populate schema metadata for both Spanner SQL dialects.INFORMATION_SCHEMA.SCHEMATA.CATALOG_NAME.DataTypesfrom dialect-supported types and merge inINFORMATION_SCHEMA.COLUMNS.SPANNER_TYPE, so types visible in the database—including types added by newer server versions—are discovered dynamically.DBNullwhen Spanner does not provide enough information to make an accurate claim.Resolves #16055.
Upstream baseline and reproduction
Updated against
googleapis/google-cloud-dotnetmainat1fa1c85336968d0bc822ee83117c31279c2c9791(2026-10-29). The upstream baseline has noSpannerConnection.GetSchemaoverride, so calls useDbConnection's unsupported default. The PR regression tests exercise the missing common collections and the newly populated schema metadata.Root cause and patch
SpannerConnectiondid not implement the common schema collection contract. The previous PR version also lacked live database discovery, provided incomplete type aliases/arrays, and did not accurately distinguish known metadata from unknown fields. The patch adds database dialect/type discovery, complete type collection columns, documented baseline type aliases, observed type merging, dialect-specific identifiers, andDBNullfor metadata that cannot be asserted accurately.Spanner does not currently expose a SQL catalog of parser keywords or a server product version query. Reserved words therefore use the published language references, selected by the live database dialect. Product version fields remain
DBNull; the provider'sServerVersionvalue0.0is a placeholder. Type families and their ADO.NET provider mappings have a documented baseline, while observed names are sourced from the connected database's information schema.Contract and references
This implements the common ADO.NET schema collections and preserves
DBNullfor unknown metadata values as permitted by the provider contract. References:The provider project retains its existing target frameworks (
netstandard2.1;net462); tests run on the repository's .NET 8 target. No target framework or public API change is introduced.Tests and validation
dotnet test ... --no-restore -f net8.0 --filter FullyQualifiedName~GetSchema— 16 passed, 0 failed.dotnet build ... --no-restore -f netstandard2.1— passed, 0 warnings, 0 errors.INFORMATION_SCHEMAis therefore not integration-verified here.Discovery
Found through
pengdows.AdoNetApiTest.conformance.Remaining limitations
Spanner does not expose SQL catalogs for its parser keyword set or a reliable server product version in the inspected references. Those fields cannot be made database-dynamic with the documented SQL interfaces; keyword data follows the published dialect references and version fields remain unknown. Live dialect integration validation remains outstanding.