This project demonstrates how to set up and manage three SQLite databases (Users, Products, and Orders), along with concurrent data insertion using Python's threading module. The project also includes proper validation, logging, and foreign key constraints to ensure data integrity.
- Database Setup: Create
Users,Products, andOrdersdatabases with proper schema and constraints. - Validation: Ensures data integrity with checks for valid users, products, and orders.
- Concurrency: Uses Python's threading module for concurrent data insertion.
- Logging: Tracks all major operations in a
system.logfile.
- Python 3.7+
- SQLite
- Clone this repository:
git clone https://github.com/trijal18/sqlite-dev
- Navigate to the project directory:
cd sqlite-setup-project - Install required dependencies (if any):
pip install -r requirements.txt
- Run the main script to insert data concurrently:
python main.py
├── main.py # Main script to set up databases and insert data
├── setup_databases.py # Database setup functions
├── data_insertion.py # Data insertion functions
├── data_validation.py # Validation logic for data integrity
├── data.py # Sample data for users, products, and orders
├── system.log # Log file for tracking operations
└── README.md # Project documentation
All major operations are logged to system.log with timestamps, including:
- Database creation events
- Data insertion success and errors
- Validation failures