| Crates.io | mysql_inserter |
| lib.rs | mysql_inserter |
| version | 0.4.2 |
| created_at | 2025-07-03 23:36:46.090752+00 |
| updated_at | 2025-07-07 10:05:22.713464+00 |
| description | Personal usage MySQL executor. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1737256 |
| size | 88,086 |
Install Rust using the following command in your terminal:
brew install rust
After installation, check that Rust is correctly added to your environment variable (PATH).
Navigate to your project directory and run the following command to generate a release build:
cargo build --release
Once the build is completed, the executable file will be created at:
./target/release/mysql_inserter
Prepare a .env file as shown below (be sure to assign values for each key):
DB_PORT=3306
DB_URL=localhost
DB_NAME=cci
DB_USER=root
DB_PW=
NUM_THREADS=8
TRANSACTION=true
true if you want to process each SQL in a transaction block, otherwise set to false.Note: You must explicitly specify the .env file when running the program. If not specified, an error will occur.
Execute the program in your terminal as follows:
./target/release/mysql_inserter <sql-dir> <dotenv-path>
<sql-dir>: Path to the directory containing the .sql files to execute.
<dotenv-path>: Full path to the .env file to use.
Example:
./target/release/mysql_inserter ./sqls ./myenv.env
.sql files in the specified directory into RAM (a progress bar will be displayed).finished/ subfolder under the original folder../logs/transaction_YYYYMMDD_HHMMSS.log (structured JSON with detailed logs per file) and summarized/warned in the console../logs/) and successfully executed SQL files (in the finished/ directory) must be managed manually.⚠️ Always double-check the scripts and perform a full backup before running this program on a critical database.