| Crates.io | schemr |
| lib.rs | schemr |
| version | 0.1.0 |
| created_at | 2025-05-10 06:06:56.835913+00 |
| updated_at | 2025-05-10 06:06:56.835913+00 |
| description | A Rust CLI for MySQL schema dumping and diffing |
| homepage | |
| repository | https://github.com/kaynenotkanye/schemr |
| max_upload_size | |
| id | 1668118 |
| size | 81,216 |
schemr is a schema management CLI written in Rust. It allows you to:
.toml file or interactive setupcargo install schemr
Set up schemr.toml in the current directory, or run:
schemr configure
You can also set environment variables for sensitive values like DB passwords.
schemr dump-schema --env qa
schemr dump-schema --env prod
schemr compare --env1 qa --env2 prod
The terminal output will show the schema diffs for the configured environments (within the schemr.toml file)
If the terminal output is difficult to read, schemr compare will also generate a friendly HTML report as well.
schemr.toml should look like:
[qa]
host = "someqa.example.com"
port = 3306
username = "root"
password_env = "ENV_VAR_FOR_SCHEMR_DB_PASSWORD_QA"
database = "yourdbname"
[prod]
host = "someprod.example.com"
port = 3306
username = "root"
password_env = "ENV_VAR_FOR_SCHEMR_DB_PASSWORD_PROD"
database = "yourdbname"
Please note that I do not allow actual passwords within the schemr.toml file. The password_env is the ENVIRONMENT_VARIABLE_NAME of what the password will be. You will then need to either set the ENVIRONMENT_VARIABLE either within .bashrc, .zshrc, or just use export
Example export commands:
export ENV_VAR_FOR_SCHEMR_DB_PASSWORD_QA=yourqapassword
export ENV_VAR_FOR_SCHEMR_DB_PASSWORD_PROD=yourprodpassword
schemr/
├── src/
│ ├── main.rs
│ ├── cli.rs
│ ├── config.rs
│ ├── compare.rs
│ └── schema.rs
├── schema-dumps/
│ ├── env1/
│ └── env2/
├── schemr.toml
├── README.md
└── Cargo.toml
The command schemr configure will auto-generate the schemr.toml file, or advanced users may create/modify this manually.
MIT License.