Skip to content
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

feat: add schemalex/schemalex #10219

Merged
merged 4 commits into from Feb 26, 2023

Conversation

ponkio-o
Copy link
Sponsor Contributor

@ponkio-o ponkio-o commented Feb 26, 2023

#10219 schemalex/schemalex: Generate difference sql of two mysql schema

$ aqua g -i schemalex/schemalex

How to confirm if this package works well

Reviewers aren't necessarily familiar with this package, so please describe how to confirm if this package works well. Please confirm if this package works well yourself as much as possible.

Command and output

$ schemalex --help
schemalex version v0.1.1

schemalex -version
schemalex [options...] before after

-v            Print out the version and exit
-o file       Output the result to the specified file (default: stdout)
-t[=true]     Enable/Disable transaction in the output (default: true)

"before" and "after" may be a file path, or a URI.
Special URI schemes "mysql" and "local-git" are supported on top of
"file". If the special path "-" is used, it is treated as stdin

Examples:

* Compare local files
  schemalex /path/to/file /another/path/to/file
  schemalex file:///path/to/file /another/path/to/file

* Compare local file against online mysql schema
  schemalex /path/to/file "mysql://user:password@tcp(host:port)/dbname?option=value"

* Compare file in local git repository against local file
  schemalex "local-git:///path/to/repo?file=foo.sql&commitish=deadbeaf" /path/to/file

* Compare schema from stdin against local file
        .... | schemalex - /path/to/file
$ schemadiff --help
schemadiff version v0.1.1

schemadiff -version
schemadiff [options...] before after

-v            Print out the version and exit
-o file	      Output the result to the specified file (default: stdout)
-t[=true]     Enable/Disable transaction in the output (default: true)

"before" and "after" may be a file path, or a URI.
Special URI schemes "mysql" and "local-git" are supported on top of
"file". If the special path "-" is used, it is treated as stdin

Examples:

* Compare local files
  schemadiff /path/to/file /another/path/to/file
  schemadiff file:///path/to/file /another/path/to/file

* Compare local file against online mysql schema
  schemadiff /path/to/file "mysql://user:password@tcp(host:port)/dbname?option=value"

* Compare file in local git repository against local file
  schemadiff "local-git:///path/to/repo?file=foo.sql&commitish=deadbeaf" /path/to/file

* Compare schema from stdin against local file
	.... | schemadiff - /path/to/file
$ schemalint --help
schemalint version v0.1.1

schemalint -version
schemalint [options...] source

-v            Print out the version and exit
-o file	      Output the result to the specified file (default: stdout)
-i number     Number of spaces to insert as indent (default: 2)

"source" may be a file path, or a URI.
Special URI schemes "mysql" and "local-git" are supported on top of
"file". If the special path "-" is used, it is treated as stdin.

Examples:

* Lint a local file
  schemalint /path/to/file
  schemalint file:///path/to/file

* Lint an online mysql schema
  schemalint "mysql://user:password@tcp(host:port)/dbname?option=value"

* Lint a file in local git repository 
  schemalint "local-git:///path/to/repo?file=foo.sql&commitish=deadbeaf"

* Lint schema from stdin against local file
	.... | schemalint -

Reference

[schemalex/schemalex](https://github.com/schemalex/schemalex): Generate difference sql of two mysql schema

```console
$ aqua g -i schemalex/schemalex
```

## How to confirm if this package works well

Reviewers aren't necessarily familiar with this package, so please describe how to confirm if this package works well.
Please confirm if this package works well yourself as much as possible.

Command and output

```console
$
```

If files such as configuration file are needed, please share them.

```
```

Reference

-
@ponkio-o
Copy link
Sponsor Contributor Author

I tried https://github.com/aquaproj/generate-registry-deep right away. It's very useful 👍 👍

But, didn't can detect files section. I thought it would be more convenient if files were supported.
The following URL is actually workflow result:
https://github.com/ponkio-o/generate-registry-deep/actions/runs/4274260509

@suzuki-shunsuke
Copy link
Member

Thank you always!

I tried https://github.com/aquaproj/generate-registry-deep right away. It's very useful 👍 👍

Thank you for your feedback. Yeah, I think so too!

This package doesn't have version_overrides, but please see #10216 and https://github.com/aquaproj/generate-registry-deep/actions/runs/4273803446 .
Generated version_overrides is so complicated that it is difficult to implement it manually. It's so powerful!

But, didn't can detect files section. I thought it would be more convenient if files were supported.

This is a known issue.
To solve the issue, aqua has to download and unarchive assets per release, which is a bit heavy process.
So I didn't implement the feature, but maybe we will be able to support the feature.

@suzuki-shunsuke suzuki-shunsuke merged commit ce00c25 into aquaproj:main Feb 26, 2023
@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Feb 26, 2023
@suzuki-shunsuke suzuki-shunsuke added this to the v3.138.0 milestone Feb 26, 2023
@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented Feb 26, 2023

@ponkio-o
Maybe you're aware but let me share just in case. You can generate version_overrides by aqua-registry scaffold --deep command. Be careful GitHub API rate limiting if there are many GitHub Releases.

https://github.com/aquaproj/aqua-registry/blob/main/CONTRIBUTING.md#bulb-generate-version_overrides

e.g.

$ aqua-registry scaffold --deep schemalex/schemalex

@suzuki-shunsuke
Copy link
Member

@suzuki-shunsuke
Copy link
Member

But, didn't can detect files section. I thought it would be more convenient if files were supported.

Created an issue. aquaproj/aqua#1667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants