{"id":13721461,"url":"https://github.com/daichirata/hammer","last_synced_at":"2026-02-15T14:09:41.608Z","repository":{"id":37047031,"uuid":"227030764","full_name":"daichirata/hammer","owner":"daichirata","description":"🛠 hammer is a command-line tool to schema management for Google Cloud Spanner.","archived":false,"fork":false,"pushed_at":"2025-09-01T04:39:20.000Z","size":417,"stargazers_count":93,"open_issues_count":5,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-01T06:53:50.730Z","etag":null,"topics":["google-cloud-spanner","schema","spanner"],"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/daichirata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-10T04:43:21.000Z","updated_at":"2025-09-01T04:33:34.000Z","dependencies_parsed_at":"2024-08-29T03:31:44.182Z","dependency_job_id":"4a1f9d49-1d1f-49f0-8ff1-7c7962708d0e","html_url":"https://github.com/daichirata/hammer","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/daichirata/hammer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daichirata%2Fhammer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daichirata%2Fhammer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daichirata%2Fhammer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daichirata%2Fhammer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daichirata","download_url":"https://codeload.github.com/daichirata/hammer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daichirata%2Fhammer/sbom","scorecard":{"id":317016,"data":{"date":"2025-08-11","repo":{"name":"github.com/daichirata/hammer","commit":"62c82399c92d09bd4ffb86bfdc03d91ff4781d9a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","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":"Maintained","score":10,"reason":"16 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yaml:9","Warn: no topLevel permission defined: .github/workflows/test.yaml: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/release.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/daichirata/hammer/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/daichirata/hammer/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/daichirata/hammer/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/daichirata/hammer/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/daichirata/hammer/test.yaml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party 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":"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":"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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yaml:14"],"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.7.0-beta.3 not signed: https://api.github.com/repos/daichirata/hammer/releases/234460120","Warn: release artifact v0.7.0-beta.2 not signed: https://api.github.com/repos/daichirata/hammer/releases/223479456","Warn: release artifact v0.7.0-beta.1 not signed: https://api.github.com/repos/daichirata/hammer/releases/223106407","Warn: release artifact v0.7.0-beta not signed: https://api.github.com/repos/daichirata/hammer/releases/222829622","Warn: release artifact v0.6.5 not signed: https://api.github.com/repos/daichirata/hammer/releases/172472394","Warn: release artifact v0.7.0-beta.3 does not have provenance: https://api.github.com/repos/daichirata/hammer/releases/234460120","Warn: release artifact v0.7.0-beta.2 does not have provenance: https://api.github.com/repos/daichirata/hammer/releases/223479456","Warn: release artifact v0.7.0-beta.1 does not have provenance: https://api.github.com/repos/daichirata/hammer/releases/223106407","Warn: release artifact v0.7.0-beta does not have provenance: https://api.github.com/repos/daichirata/hammer/releases/222829622","Warn: release artifact v0.6.5 does not have provenance: https://api.github.com/repos/daichirata/hammer/releases/172472394"],"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9"],"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-18T00:26:04.855Z","repository_id":37047031,"created_at":"2025-08-18T00:26:04.855Z","updated_at":"2025-08-18T00:26:04.855Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":["google-cloud-spanner","schema","spanner"],"created_at":"2024-08-03T01:01:17.375Z","updated_at":"2026-01-14T23:55:35.694Z","avatar_url":"https://github.com/daichirata.png","language":"Go","funding_links":[],"categories":["Tools"],"sub_categories":["ORM"],"readme":"# hammer\n\nhammer is a command-line tool to schema management for Google Cloud Spanner.\n\n![](https://github.com/daichirata/hammer/workflows/Test/badge.svg)\n\n## Installation\n\nDownload the single-binary executable from:\n\nhttps://github.com/daichirata/hammer/releases\n\nor\n\n``` shell\n$ go install github.com/daichirata/hammer@latest\n```\n\n## Usage\n\n```\n$ hammer -h\nhammer is a command-line tool to schema management for Google Cloud Spanner.\n\nUsage:\n  hammer [command]\n\nExamples:\n\n* Export spanner schema\n  hammer export spanner://projects/projectId/instances/instanceId/databases/databaseName \u003e schema.sql\n\n* Apply local schema file\n  hammer apply spanner://projects/projectId/instances/instanceId/databases/databaseName /path/to/file\n\n* Create database and apply local schema (faster than running database creation and schema apply separately)\n  hammer create spanner://projects/projectId/instances/instanceId/databases/databaseName /path/to/file\n\n* Copy database\n  hammer create spanner://projects/projectId/instances/instanceId/databases/databaseName1 spanner://projects/projectId/instances/instanceId/databases/databaseName2\n\n* Compare local files\n  hammer diff /path/to/file /another/path/to/file\n\n* Compare local file against spanner schema\n  hammer diff /path/to/file spanner://projects/projectId/instances/instanceId/databases/databaseName\n\n* Compare spanner schema against spanner schema\n  hammer diff spanner://projects/projectId/instances/instanceId/databases/databaseName1 spanner://projects/projectId/instances/instanceId/databases/databaseName2\n\nAvailable Commands:\n  apply       Apply schema\n  create      Create database and apply schema\n  diff        Diff schema\n  export      Export schema\n  help        Help about any command\n\nFlags:\n  -h, --help   help for hammer\n\nUse \"hammer [command] --help\" for more information about a command.\n```\n\nThe DSN must be given in the following format.\n\n```\nspanner://projects/{projectId}/instances/{instanceId}/databases/{databaseName}?credentials=/path/to/file.json\n```\n\n| Param          | Required |  Description                                                                                   |\n| -------------- | -------- | ---------------------------------------------------------------------------------------------- |\n| `projectId`    | true     | The Google Cloud Platform project id                                                           |\n| `instanceId`   | true     | The id of the instance running Spanner                                                         |\n| `databaseName` | true     | The name of the Spanner database                                                               |\n| `credentials`  | false    | The path to the keyfile. If not present, client will use your default application credentials. |\n\n### Flags\n\napply, create, diff and export can accept the flags defined below\n\n```\n--ignore-alter-database   ignore alter database statements\n--ignore-change-streams   ignore change streams statements\n--ignore-models           ignore model statements\n```\n\n### Examples\n\nSuppose you have an existing SQL schema like the following:\n\n``` sql\nCREATE TABLE users (\n  user_id STRING(36) NOT NULL,\n  email STRING(MAX),\n) PRIMARY KEY(user_id);\n```\n\nAnd you want \"upgrade\" your schema to the following:\n\n``` sql\nCREATE TABLE users (\n  user_id STRING(36) NOT NULL,\n  email STRING(MAX) NOT NULL,\n  age INT64,\n  name STRING(MAX) NOT NULL,\n) PRIMARY KEY(user_id);\nCREATE INDEX idx_users_name ON users (name);\n```\n\nHammer changes the schema by applying the following SQL to the spanner:\n\n``` sql\nhammer diff old.sql new.sql\n\nUPDATE users SET email = '' WHERE email IS NULL;\nALTER TABLE users ALTER COLUMN email STRING(MAX) NOT NULL;\nALTER TABLE users ADD COLUMN age INT64;\nALTER TABLE users ADD COLUMN name STRING(MAX) NOT NULL DEFAULT (\"\");\nALTER TABLE users ALTER COLUMN name DROP DEFAULT;\nCREATE INDEX idx_users_name ON users(name);\n```\n\n- When altering a nullable column to add the NOT NULL attribute, hammer update the column with the default value, and then add the NOT NULL attribute. (e.g. email)\n- When adding a column with the NOT NULL attribute without the DEFAULT attribute, hammer add a default value to the column implicitly, and then drop the DEFAULT attribute. (e.g. name)\n\n## LICENSE\n\nUnless otherwise noted, the hammer source files are distributed under the MIT License found in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaichirata%2Fhammer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaichirata%2Fhammer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaichirata%2Fhammer/lists"}