Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements new system tables and their integration tests to handle Dolt schemas history and diff data. Key changes include:
- Adding integration tests for querying dolt_history_dolt_schemas and dolt_diff_dolt_schemas.
- Introducing a new implementation for the dolt_history_dolt_schemas table.
- Updating the database table lookup to handle schema history and diff tables.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| integration-tests/bats/system-tables.bats | Added integration tests for querying history and diff system tables |
| go/libraries/doltcore/sqle/integration_test/dolt_schemas_history_diff_test.go | New tests for verifying schema history and diff tables |
| go/libraries/doltcore/sqle/dolt_schemas_history_table.go | Implementation of the dolt_history_dolt_schemas system table |
| go/libraries/doltcore/sqle/database.go | Updated handling to include schema history and diff tables |
| # dolt_diff_dolt_schemas starts empty | ||
| run dolt sql -q 'SELECT COUNT(*) FROM dolt_diff_dolt_schemas' | ||
| [ "$status" -eq 0 ] | ||
| [[ "$output" =~ " 0 " ]] || false |
There was a problem hiding this comment.
[nitpick] Consider using regex anchors or trimming whitespace to ensure exact matching of numerical output rather than relying on substring matches, which could lead to false positives if formatting changes.
Suggested change
| [[ "$output" =~ " 0 " ]] || false | |
| [[ "$output" =~ ^0$ ]] || false |
| func (dsht *doltSchemasHistoryTable) PrimaryKeySchema() sql.PrimaryKeySchema { | ||
| return sql.PrimaryKeySchema{ | ||
| Schema: dsht.Schema(), | ||
| PkOrdinals: []int{0, 1, 5}, // type, name, commit_hash |
There was a problem hiding this comment.
[nitpick] Although the primary key composition is described by the comment, consider explicitly documenting the column ordering to improve clarity and facilitate future modifications.
Suggested change
| PkOrdinals: []int{0, 1, 5}, // type, name, commit_hash | |
| PkOrdinals: []int{0, 1, 5}, // Primary key columns: | |
| // 0 - type (column index 0 in schema) | |
| // 1 - name (column index 1 in schema) | |
| // 5 - commit_hash (column index 5 in schema) |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.