A robust, flexible Rust-based CSV importer that supports multiple databases, real-time file watching, data validation, and notification systems.
-
Multi-Database Support
- PostgreSQL
- MySQL
- MariaDB
- SQLite (Planned)
-
Advanced CSV Processing
- Real-time directory watching
- Automatic CSV file detection
- Data validation
- Duplicate detection
- Batch insertions
-
Flexible Notifications
- Telegram
- Email (Planned)
- Slack (Planned)
- Custom notification channels (Planned)
- Rust (latest stable version)
- Cargo
- Database servers (PostgreSQL, MySQL)
- Clone the repository
git clone https://github.com/irfnrdh/csv-import-db.git
cd csv-import-db
- Install dependencies
cargo build
Create a config.toml
file with your database and notification settings:
[database]
types = ["postgresql", "mysql"]
host = "localhost"
port = 5432
username = "your_username"
password = "your_password"
[notification]
telegram_token = "your_telegram_bot_token"
telegram_chat_id = "your_chat_id"
cargo run --release
Generate Dataset Samples
cargo run --bin generate_csv
multi-db-csv-importer/
โ
โโโ src/
โ โโโ main.rs # Main application entry point
โ โโโ config/ # Configuration handling
โ โ โโโ mod.rs
โ โ โโโ database.rs
โ โ โโโ notification.rs
โ โ
โ โโโ importers/ # CSV import logic
โ โ โโโ mod.rs
โ โ โโโ csv_processor.rs
โ โ โโโ validator.rs
โ โ
โ โโโ database/ # Database connectors
โ โ โโโ mod.rs
โ โ โโโ mysql.rs
โ โ โโโ postgres.rs
โ โ โโโ sqlite.rs
โ โ
โ โโโ notifications/ # Notification systems
โ โโโ mod.rs
โ โโโ telegram.rs
โ โโโ email.rs
โ
โโโ tests/ # Unit and integration tests
โ โโโ database_tests.rs
โ โโโ importer_tests.rs
โ
โโโ Cargo.toml # Project dependencies
โโโ Config.toml # Project env
โโโ README.md # Project documentation
โโโ LICENSE # Project license
โโโ .gitignore # Git ignore file
Run tests with:
cargo test
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Irfannur Diah - irfnrdh@gmail.com
Project Link: https://github.com/irfnrdh/csv-import-db