A Python utility for executing SQL files against databases with support for multiple statements, comments, and pretty-printed results
Project description
splurge-sql-runner
A robust, secure, and user-friendly Python utility for executing SQL files against databases with support for multiple statements, comments, and formatted results.
✨ Key Features
- 🔧 Multi-Statement Execution: Process SQL files containing multiple statements
- 🗄️ Database Agnostic: Support for SQLite, PostgreSQL, MySQL, Oracle, and more
- 🔒 Security First: Configurable validation for SQL content and database URLs
- 📊 Smart Output: Pretty tables, JSON format, and verbose logging
- ⚙️ Flexible Configuration: CLI args, JSON files, and environment variables
- 🛡️ Error Recovery: Continue processing on errors with detailed reporting
🚀 Quick Start
Installation
pip install splurge-sql-runner
Basic Usage
# Execute a single SQL file
splurge-sql-runner -c "sqlite:///database.db" -f "script.sql"
# Execute multiple SQL files using a pattern
splurge-sql-runner -c "sqlite:///database.db" -p "*.sql"
# With verbose output
splurge-sql-runner -c "sqlite:///database.db" -f "script.sql" -v
# JSON output for scripting
splurge-sql-runner -c "sqlite:///database.db" -f "query.sql" --json
📚 Documentation
- 📖 Detailed Documentation - Complete feature guide, configuration options, and examples
- 🔧 CLI Reference - Comprehensive command-line options and usage
- 📋 Changelog - Version history and release notes
📋 Requirements
- Python: 3.10 or higher
- SQLAlchemy: Database connectivity
- splurge-safe-io: Secure file I/O operations
🤝 Contributing
We welcome contributions! Please see our detailed documentation for development setup and contribution guidelines.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
For the complete documentation, visit docs/README-DETAILS.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splurge_sql_runner-2025.5.0.tar.gz.
File metadata
- Download URL: splurge_sql_runner-2025.5.0.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd836e160cee43dc9ff7821ae8d9e70894fd4a879330585cea91df47d5b3e6f7
|
|
| MD5 |
6d9f41c07501ad5e703734a0118dd88d
|
|
| BLAKE2b-256 |
800bdbbb2eb48ddc4dda4a3da9f0cb244406121d452c335793eaf8c484a196f6
|
File details
Details for the file splurge_sql_runner-2025.5.0-py3-none-any.whl.
File metadata
- Download URL: splurge_sql_runner-2025.5.0-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
572302c882561f7ddbeba2484bf562a53d8853d7d4ea2c00afbe36ffb128ef02
|
|
| MD5 |
2e75303ca4a448a228101ade7acce189
|
|
| BLAKE2b-256 |
476450a02ef34b67553b96a6fa8e9a9ff6316ff63fda9cd22e1a7ceeeff061e9
|