-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
Migrate dolt diff
and dolt show
to SQL implementation
#6221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Get the tests passing and ship it!
- temporarily disable `dolt show` - introduce TableInfo struct to maintain SQL table state - update diffWriter to use non-doltdb primitives - update diff.go to use non-doltdb primitives and load most data from SQL
- got basic commit details SQL going - able to print a rudimentary --no-pretty output for basic case
Update `dolt_log` table function to handle "HEAD" as a ref.
…t the create statement. Also, only write out alter statements when they are non-empty.
Update diff.bats tests to remove foreign key resolution text.
When running the command, we determine if `DoltEnv` is required by checking if `--no-pretty` is set, or the user specified non-commit hashes as the input. These two scenarios result in us logging storage-specific data, for which we require `DoltEnv`.
- pass in the timestamp to the error that reports timestamp parsing issues - fix a failing BATS test
…enoting an non-existent table.
- use dbr.InterpolateForDialect to construct queries - remove commented-out lines - fix function comments - add comments to resolveNonCommitSpec
- rename all show.go `show*` functions to `print*` - moved getTimestampColAsUint64 to utils - if needing to execute in local mode, check the type of Queryist to figure this out
1d59d8d
to
dfdcbc4
Compare
… `limit` in `dbr.Expr`, which avoids quoting the contents.
…ert the value (which may be a string) to the correct type.
# Conflicts: # integration-tests/bats/sql-local-remote.bats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change requested for how you set the password in the tests. fix and ship!
cd defaultDB | ||
|
||
export DOLT_CLI_PASSWORD="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We unset the DOLT_CLI_PASSWORD var in this file, so I'd prefer you just set the --password
everywhere, OR you can specify no user/pwd (which should work now that my auth changes are in).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, dropping --user
arguments in these tests.
@@ -384,6 +386,8 @@ EOF | |||
@test "sql-local-remote: verify dolt show behavior" { | |||
cd defaultDB | |||
|
|||
export DOLT_CLI_PASSWORD="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous response :)
…al-remote.bats diff tests.
This change migrates the current
dolt diff
implementation to use only SQL.This is done by offloading most of the diffing logic to
dolt_diff
anddolt_schema_diff
table functions, and making some of the common code generic, so we don't have to rely on DoltDb objects (which rely on dolt internals).This change also partially migrates
dolt show
to SQL.dolt show
has the ability to log some of the storage internals in two cases:--no-pretty
flag is specifieddolt show
is invoked against non-commit hashesWhen either of the above cases occurs, we use DoltEnv to get these structures and log them. In all other cases, we use SQL to get the list of changes.