{"id":36511993,"url":"https://github.com/schemalex/schemalex","last_synced_at":"2026-04-08T12:37:49.915Z","repository":{"id":33876550,"uuid":"37586301","full_name":"schemalex/schemalex","owner":"schemalex","description":"Generate difference sql of two mysql schema","archived":false,"fork":false,"pushed_at":"2021-04-22T22:37:03.000Z","size":372,"stargazers_count":481,"open_issues_count":22,"forks_count":56,"subscribers_count":14,"default_branch":"master","last_synced_at":"2026-01-15T06:13:40.995Z","etag":null,"topics":["golang","mysql","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schemalex.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-17T09:40:14.000Z","updated_at":"2025-12-03T01:45:14.000Z","dependencies_parsed_at":"2022-08-28T19:20:14.734Z","dependency_job_id":null,"html_url":"https://github.com/schemalex/schemalex","commit_stats":null,"previous_names":["soh335/schemalex"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/schemalex/schemalex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemalex%2Fschemalex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemalex%2Fschemalex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemalex%2Fschemalex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemalex%2Fschemalex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schemalex","download_url":"https://codeload.github.com/schemalex/schemalex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemalex%2Fschemalex/sbom","scorecard":{"id":803808,"data":{"date":"2025-08-11","repo":{"name":"github.com/schemalex/schemalex","commit":"bf2603ccbd8b4d7a012ec95827dcfd6689a741e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":9,"reason":"Found 11/12 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/schemalex/schemalex/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/schemalex/schemalex/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/schemalex/schemalex/test.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.1.1 not signed: https://api.github.com/repos/schemalex/schemalex/releases/21639406","Warn: release artifact v0.0.10 not signed: https://api.github.com/repos/schemalex/schemalex/releases/16193882","Warn: release artifact v0.0.9 not signed: https://api.github.com/repos/schemalex/schemalex/releases/13316378","Warn: release artifact v0.0.8 not signed: https://api.github.com/repos/schemalex/schemalex/releases/8213978","Warn: release artifact v0.0.7 not signed: https://api.github.com/repos/schemalex/schemalex/releases/8077745","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/schemalex/schemalex/releases/21639406","Warn: release artifact v0.0.10 does not have provenance: https://api.github.com/repos/schemalex/schemalex/releases/16193882","Warn: release artifact v0.0.9 does not have provenance: https://api.github.com/repos/schemalex/schemalex/releases/13316378","Warn: release artifact v0.0.8 does not have provenance: https://api.github.com/repos/schemalex/schemalex/releases/8213978","Warn: release artifact v0.0.7 does not have provenance: https://api.github.com/repos/schemalex/schemalex/releases/8077745"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T11:14:35.096Z","repository_id":33876550,"created_at":"2025-08-23T11:14:35.096Z","updated_at":"2025-08-23T11:14:35.096Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31556238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","mysql","parser"],"created_at":"2026-01-12T02:37:17.205Z","updated_at":"2026-04-08T12:37:49.903Z","avatar_url":"https://github.com/schemalex.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# schemalex\n\nGenerate the difference of two mysql schema\n\n![Test](https://github.com/schemalex/schemalex/workflows/Test/badge.svg)\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/schemalex/schemalex?tab=doc)](https://pkg.go.dev/github.com/schemalex/schemalex?tab=doc)\n\n## SYNOPSIS\n\nThis tool can be used to generate the difference, or more precisely,\nthe statements required to migrate from/to, between two MySQL\nschema.\n\nSuppose you have an existing SQL schema like the following:\n\n```sql\nCREATE TABLE hoge (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    PRIMARY KEY (id)\n);\n```\n\nAnd you want \"upgrade\" your schema to the following:\n\n\n```sql\nCREATE TABLE hoge (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    c VARCHAR (20) NOT NULL DEFAULT \"hoge\",\n    PRIMARY KEY (id)\n);\n\nCREATE TABLE fuga (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    PRIMARY KEY (id)\n);\n```\n\nUsing `schemalex` you can generate a set of commands to perform the migration:\n\n```\nschemalex old.sql new.sql\n\nSET FOREIGN_KEY_CHECKS = 0;\n\nCREATE TABLE `fuga` (\n`id` INTEGER NOT NULL AUTO_INCREMENT,\nPRIMARY KEY (`id`)\n);\n\nALTER TABLE `hoge` ADD COLUMN `c` VARCHAR (20) NOT NULL DEFAULT \"hoge\";\n\nSET FOREIGN_KEY_CHECKS = 1;\n\nCOMMIT;\n```\n\nYou can also use URI formatted strings as the sources to compare,\nwhich allow you to compare local files against online schema,\na version committed to your git repository against another version,\netc.\n\nPlease see the help command for a list\n\n```\nschemalex -version\nschemalex [options...] before after\n\n-v            Print out the version and exit\n-o file\t      Output the result to the specified file (default: stdout)\n-t[=true]     Enable/Disable transaction in the output (default: true)\n\n\"before\" and \"after\" may be a file path, or a URI.\nSpecial URI schemes \"mysql\" and \"local-git\" are supported on top of\n\"file\". If the special path \"-\" is used, it is treated as stdin\n\nExamples:\n\n* Compare local files\n  schemalex /path/to/file /another/path/to/file\n  schemalex file:///path/to/file /another/path/to/file\n\n* Compare local file against online mysql schema\n  schemalex /path/to/file \"mysql://user:password@tcp(host:port)/dbname?option=value\"\n\n* Compare file in local git repository against local file\n  schemalex \"local-git:///path/to/repo?file=foo.sql\u0026commitish=deadbeaf\" /path/to/file\n\n* Compare schema from stdin against local file\n\t.... | schemalex - /path/to/file\n```\n\n## SYNOPSIS (Using the library)\n\nBelow is the equivalent of the previous SYNOPSIS.\n\n```\npackage schemalex_test\n\nimport (\n\t\"os\"\n\n\t\"github.com/schemalex/schemalex/diff\"\n)\n\nfunc Example() {\n\tconst sql1 = `CREATE TABLE hoge (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    PRIMARY KEY (id)\n);`\n\tconst sql2 = `CREATE TABLE hoge (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    c VARCHAR (20) NOT NULL DEFAULT \"hoge\",\n    PRIMARY KEY (id)\n);\n\nCREATE TABLE fuga (\n    id INTEGER NOT NULL AUTO_INCREMENT,\n    PRIMARY KEY (id)\n);`\n\n\tdiff.Strings(os.Stdout, sql1, sql2, diff.WithTransaction(true))\n\n\t// OUTPUT:\n\t// BEGIN;\n\t//\n\t// SET FOREIGN_KEY_CHECKS = 0;\n\t//\n\t// CREATE TABLE `fuga` (\n\t// `id` INTEGER NOT NULL AUTO_INCREMENT,\n\t// PRIMARY KEY (`id`)\n\t// );\n\t//\n\t// ALTER TABLE `hoge` ADD COLUMN `c` VARCHAR (20) NOT NULL DEFAULT \"hoge\";\n\t//\n\t// SET FOREIGN_KEY_CHECKS = 1;\n\t//\n\t// COMMIT;\n}\n```\n\n## SEE ALSO\n\n* http://blog.gopheracademy.com/advent-2014/parsers-lexers/\n* https://github.com/soh335/git-schemalex\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschemalex%2Fschemalex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschemalex%2Fschemalex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschemalex%2Fschemalex/lists"}