magiceye

Crates.iomagiceye
lib.rsmagiceye
version0.3.2
sourcesrc
created_at2024-10-23 15:01:55.327486
updated_at2024-11-10 15:42:54.118204
descriptiondatabase diff checker
homepagehttps://github.com/myyrakle/magiceye/blob/master/README.md
repositoryhttps://github.com/myyrakle/magiceye
max_upload_size
id1420263
size139,793
myyrakle (myyrakle)

documentation

https://docs.rs/magiceye/latest/magiceye

README

magiceye

GitHub license

  • database diff checker

What is this?

  • When managing a DB with multiple versions such as production, stage, qa, develop, etc., a situation may arise where the DB schema is partially inconsistent.
  • In such situations, this tool detects and reports inconsistencies between databases.

Get Started

Install using cargo

cargo install magiceye

Then, use the init command to enter database information, etc.

magiceye init

This is the database where the base connection URL is the reference point.

magiceye detects and reports the following two targets:

  1. Something in the base database but not in the target database.
  2. It exists in both the base database and the target database, but the types are different.

Once you have completed the settings through the init command, you can start collecting reports with the run command.

magiceye run

If you have a lot of tables, collecting DDL information may take some time.

When processing is complete, a report file is created in the form "2024-01-30 18:53.json".

Supported DBMS

  • postgresql
  • mysql

Supported Report Language

  • English
  • Korean

Report Example

{
  "report_table_list": [
    {
      "table_name": "followers",
      "report_list": [
        "Index: followers.idx_follower_follower_id exists in the base database, but not in the target database."
      ]
    },
    {
      "table_name": "reports_fk_test",
      "report_list": [
        "Index: reports_fk_test.post_id exists in the base database, but not in the target database.",
        "Foreign Key: reports_fk_test.reports_fk_test_ibfk_2 exists in the base database, but not in the target database."
      ]
    },
    {
      "table_name": "posts",
      "report_list": [
        "Column: posts.id has different AUTO_INCREMENT. => AUTO_INCREMENT != NOT AUTO_INCREMENT",
        "Column: posts.title has different default value. => asdf != "
      ]
    },
    {
      "table_name": "tags",
      "report_list": [
        "Column: tags.name has different data type. => varchar(255) != varchar(155)"
      ]
    }
  ]
}
Commit count: 142

cargo fmt