And adds support for exporting views with the -schema-view.sql suffix, avoids running the view queries and exporting data from them unnecessarily, and allows for restoring / overwriting the views when the --overwrite-tables flag is passed in.
The goal was to implement the desired functionality with minimal changes to the existing files but the new information_schema query that was added in dumper.go did lead to some required additions in the dumper_test.go file.
As I also have PR#910 open at the moment that includes other modifications to dumper.go and loader.go this one may be simpler to review / approve first and then I can update the other pull request afterward.
This should address the problem described in the following two issues: https://github.com/planetscale/cli/issues/921 https://github.com/planetscale/cli/issues/701
And adds support for exporting views with the
-schema-view.sql
suffix, avoids running the view queries and exporting data from them unnecessarily, and allows for restoring / overwriting the views when the--overwrite-tables
flag is passed in.The goal was to implement the desired functionality with minimal changes to the existing files but the new
information_schema
query that was added indumper.go
did lead to some required additions in thedumper_test.go
file.As I also have PR#910 open at the moment that includes other modifications to
dumper.go
andloader.go
this one may be simpler to review / approve first and then I can update the other pull request afterward.