Skip to content

feat(ado.net): support more schema tables#778

Merged
olavloite merged 1 commit into
mainfrom
schema-tables
Jun 30, 2026
Merged

feat(ado.net): support more schema tables#778
olavloite merged 1 commit into
mainfrom
schema-tables

Conversation

@olavloite

Copy link
Copy Markdown
Collaborator

Add more standard schema tables to the ADO.NET driver.

Also adds integration tests for those schema tables, and a new job for running those integration tests against the Spanner emulator.

Add more standard schema tables to the ADO.NET driver.

Also adds integration tests for those schema tables, and a new job for
running those integration tests against the Spanner emulator.
@olavloite olavloite requested review from a team as code owners June 25, 2026 07:35

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements schema retrieval for 'Tables', 'Columns', 'Indexes', 'IndexColumns', and 'Foreign Keys' collections from Spanner's INFORMATION_SCHEMA in SpannerSchemaProvider.cs, along with corresponding mock server unit tests and emulator-based integration tests. The review feedback suggests dynamically retrieving the emulator host and port from the SPANNER_EMULATOR_HOST environment variable in the integration tests instead of hardcoding localhost:9010.

Comment thread spanner-ado-net/spanner-ado-net-tests/SchemaIntegrationTests.cs
Comment thread spanner-ado-net/spanner-ado-net-tests/SchemaIntegrationTests.cs
Comment thread spanner-ado-net/spanner-ado-net-tests/SchemaIntegrationTests.cs
@olavloite olavloite requested a review from sakthivelmanii June 26, 2026 09:17
private void FillIndexes(DataTable dataTable, string?[]? restrictionValues)
{
dataTable.TableName = "Indexes";
var query = "SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, INDEX_NAME, INDEX_TYPE, IS_UNIQUE, IS_NULL_FILTERED, INDEX_STATE FROM INFORMATION_SCHEMA.INDEXES WHERE 1=1";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why WHERE 1=1 is required here? (even in following methods)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because we dynamically add filter clauses like AND TABLE_SCHEMA=@schema for these queries. By adding WHERE 1=1 here, we know that we can always safely just add an AND ... clause from this point.

@olavloite olavloite merged commit 56f5b2f into main Jun 30, 2026
25 checks passed
@olavloite olavloite deleted the schema-tables branch June 30, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants