{"id":18183624,"url":"https://github.com/maxime-cllt/dbmscleaner","last_synced_at":"2026-04-09T11:35:52.007Z","repository":{"id":260752995,"uuid":"860407674","full_name":"Maxime-Cllt/DBMSCleaner","owner":"Maxime-Cllt","description":"A Rust executable program that clean and optimise your DBMS, made to be run everyday as a back-end program.","archived":false,"fork":false,"pushed_at":"2025-03-28T16:09:24.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T17:33:20.339Z","etag":null,"topics":["cleaner","dbms","executable","go","golang","mariadb","mysql","optimization","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Maxime-Cllt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-20T11:32:19.000Z","updated_at":"2025-03-15T09:11:43.000Z","dependencies_parsed_at":"2024-11-02T11:16:56.027Z","dependency_job_id":"97787201-8736-4191-a90d-ac578a0dc210","html_url":"https://github.com/Maxime-Cllt/DBMSCleaner","commit_stats":null,"previous_names":["maxime-cllt/dbmscleaner"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxime-Cllt%2FDBMSCleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxime-Cllt%2FDBMSCleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxime-Cllt%2FDBMSCleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxime-Cllt%2FDBMSCleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maxime-Cllt","download_url":"https://codeload.github.com/Maxime-Cllt/DBMSCleaner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648911,"owners_count":20972942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cleaner","dbms","executable","go","golang","mariadb","mysql","optimization","postgresql"],"created_at":"2024-11-02T20:03:39.029Z","updated_at":"2026-04-09T11:35:51.998Z","avatar_url":"https://github.com/Maxime-Cllt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e🗄️ DBMSCleaner\u003c/h1\u003e\n    \u003cp\u003e\u003ci\u003eHigh-performance database optimization tool built with Rust\u003c/i\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Rust](https://img.shields.io/badge/Rust-dea584?style=for-the-badge\u0026logo=rust\u0026logoColor=white)\n![Version](https://img.shields.io/badge/version-1.0.4-blue?style=for-the-badge)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n**Supported Databases**\n\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge\u0026logo=mysql\u0026logoColor=white)\n![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=for-the-badge\u0026logo=mariadb\u0026logoColor=white)\n\n**Platform Support**\n\n![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)\n![macOS](https://img.shields.io/badge/macOS-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white)\n![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n\n\u003c/div\u003e\n\n## 📖 Overview\n\n**DBMS Cleaner** is a lightweight, efficient tool designed to optimize and clean your database. Built with Rust, it\nensures optimal performance by reducing storage usage and optimizing all tables (except system tables) without altering\nconfigurations or requiring manual intervention.\n\nWhether you're running a server or an application, DBMS Cleaner keeps your database in peak condition, compatible across\nall major platforms.\n\n---\n\n## ✨ Key Features\n\n- 🚀 **Efficient Storage Optimization:** Reduce database size by rebuilding indexes.\n- ⚙️ **Table Optimization:** Ensures all tables (excluding system tables) are optimized.\n- 🖥️ **Cross-Platform Support:** Seamlessly run on Windows, MacOS, and Linux.\n- 🛠️ **Simple Integration:** No changes to FILE configurations required.\n- 🛡️ **Safe and Reliable:** Maintains database integrity without the need for backups.\n- 🔧 **Customizable:** Easily configure settings via `config.json`.\n- ⏱️ **Fast Execution:** Run it as a cron job or scheduled task for continuous optimization.\n\n---\n\n## 📋 Prerequisites\n\n- **Rust Compiler** (Install via [Rustup](https://rustup.rs/))\n- **Cargo Package Manager** (Installed with Rust)\n- Supported database drivers: `mysql`, `mariadb`, or `postgres`\n\n---\n\n## 🔧 Installation\n\nFollow these steps to get started:\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Maxime-Cllt/DBMSCleaner.git\ncd DBMSCleaner\n```\n\n### 2. Compile the Program\n\n```bash\ncargo build --release\n```\n\n### 3. Configure the Connection\n\nCreate a file named `cleaner.json` in the same directory as the compiled program. DBMSCleaner supports multiple\ndatabases in a single configuration file:\n\n**Multi-Database Configuration (Recommended):**\n\n```json\n{\n  \"databases\": [\n    {\n      \"name\": \"Production PostgreSQL\",\n      \"driver\": \"postgres\",\n      \"host\": \"localhost\",\n      \"port\": \"5432\",\n      \"username\": \"postgres\",\n      \"password_env\": \"POSTGRES_PASSWORD\",\n      \"schema\": \"public\"\n    },\n    {\n      \"name\": \"Analytics MySQL\",\n      \"driver\": \"mysql\",\n      \"host\": \"localhost\",\n      \"port\": \"3306\",\n      \"username\": \"root\",\n      \"password_env\": \"MYSQL_PASSWORD\",\n      \"schema\": \"analytics\"\n    }\n  ],\n  \"dry_run\": false,\n  \"require_confirmation\": true\n}\n```\n\n**Security Features:**\n\n- 🔐 Use `password_env` to reference environment variables instead of hardcoding passwords\n- ⚠️ `require_confirmation` asks for approval before running (set to `false` for automation)\n- 🔍 `dry_run` mode previews operations without executing them\n\n**Multiple Schemas:**\nYou can include multiple schemas separated by commas or use `*` to clean all schemas (except system schemas):\n\n```json\n\"schema\": \"test1,test2,test3\"\n```\n\nFor detailed configuration options, see [README_CONFIG.md](README_CONFIG.md)\n\n### 4. Run the Program\n\n**Set environment variables (if using `password_env`):**\n\n```bash\n# Linux/macOS\nexport POSTGRES_PASSWORD=\"your_secure_password\"\nexport MYSQL_PASSWORD=\"your_mysql_password\"\n\n# Windows (PowerShell)\n$env:POSTGRES_PASSWORD=\"your_secure_password\"\n$env:MYSQL_PASSWORD=\"your_mysql_password\"\n```\n\n**Execute the cleaner:**\n\n#### For MacOS \u0026 Linux:\n\n```bash\n./target/release/DBMSCleaner\n```\n\n#### For Windows:\n\n```bash\n.\\target\\release\\DBMSCleaner.exe\n```\n\n---\n\n## 🧪 Code Quality\n\n### Unit Tests available\n\nTo ensure the reliability of the DBMS Cleaner, unit tests are included. You can run the tests using Cargo:\n\n```bash\ncargo test\n```\n\n## 📝 Notes\n\n- **Exclusions:** Does not clean triggers, stored procedures, functions, or views.\n- **Privileges Required:** Ensure the program has sufficient privileges to connect and clean the database.\n- **Frequency:** Safe to run frequently for continuous optimization.\n\n---\n\n## 📊 Performance and Results\n\nI use this program to clean my database every night. Here is a graph that show the size of my database before and after\nthe cleaning process.\n\n### Size benefit\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"assets/Graph.png\" width=\"50%\" height=\"50%\" alt=\"Graph\" /\u003e\n\u003c/div\u003e\n\n## 🔗 See Also\n\n- [SQLiteCleaner](https://github.com/Maxime-Cllt/SqliteCleaner)\n- [Rust Language](https://www.rust-lang.org/)\n\n---\n\n### 📜 License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n\n## 🤝 Contributing\n\nContributions are welcome! To contribute:\n\n- **Fork the Repository**\n- **Create a Feature Branch**:\n  ```bash\n  git checkout -b feature/your-feature-name\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxime-cllt%2Fdbmscleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxime-cllt%2Fdbmscleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxime-cllt%2Fdbmscleaner/lists"}