Metadata-Version: 2.4
Name: splurge-sql-runner
Version: 2025.7.0
Summary: A Python utility for executing SQL files against databases with support for multiple statements, comments, and pretty-printed results
Author: Jim Schilling
Maintainer: Jim Schilling
License-Expression: MIT
Project-URL: Homepage, https://github.com/jim-schilling/splurge-sql-runner
Project-URL: Documentation, https://github.com/jim-schilling/splurge-sql-runner#readme
Project-URL: Repository, https://github.com/jim-schilling/splurge-sql-runner.git
Project-URL: Issues, https://github.com/jim-schilling/splurge-sql-runner/issues
Project-URL: Changelog, https://github.com/jim-schilling/splurge-sql-runner/blob/main/README.md#changelog
Keywords: sql,database,cli,sqlalchemy,sqlite,postgresql,mysql
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Environment :: Console
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlalchemy>=2.0.42
Requires-Dist: sqlparse>=0.5.3
Requires-Dist: tabulate>=0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=8.4.1; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: pytest-xdist>=3.8.0; extra == "dev"
Requires-Dist: pytest-mock>=3.15.1; extra == "dev"
Requires-Dist: mypy>=1.18.2; extra == "dev"
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
Requires-Dist: ruff>=0.12.7; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=8.4.1; extra == "test"
Requires-Dist: pytest-cov>=6.2.1; extra == "test"
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
Provides-Extra: lint
Requires-Dist: mypy>=1.18.2; extra == "lint"
Requires-Dist: ruff>=0.12.7; extra == "lint"
Dynamic: license-file

# splurge-sql-runner

[![PyPI version](https://badge.fury.io/py/splurge-sql-runner.svg)](https://pypi.org/project/splurge-sql-runner/)
[![Python versions](https://img.shields.io/pypi/pyversions/splurge-sql-runner.svg)](https://pypi.org/project/splurge-sql-runner/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

[![CI](https://github.com/jim-schilling/splurge-sql-runner/actions/workflows/ci-quick-test.yml/badge.svg)](https://github.com/jim-schilling/splurge-sql-runner/actions/workflows/ci-quick-test.yml)
[![Coverage](https://img.shields.io/badge/coverage-93%25-brightgreen.svg)](https://github.com/jim-schilling/splurge-sql-runner)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![mypy](https://img.shields.io/badge/mypy-checked-black)](https://mypy-lang.org/)


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

```bash
pip install splurge-sql-runner
```

### Basic Usage

```bash
# 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](docs/README-DETAILS.md)** - Complete feature guide, configuration options, and examples
- **[🔧 CLI Reference](docs/cli/CLI-REFERENCE.md)** - Comprehensive command-line options and usage
- **[📋 Changelog](CHANGELOG.md)** - Version history and release notes

## 📋 Requirements

- **Python**: 3.10 or higher
- **sqlparse**: SQL parsing and validation
- **SQLAlchemy**: Database connectivity
- **tabulate**: Pretty table formatting

## 🤝 Contributing

We welcome contributions! Please see our [detailed documentation](docs/README-DETAILS.md#contributing) for development setup and contribution guidelines.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

*For the complete documentation, visit [docs/README-DETAILS.md](docs/README-DETAILS.md)*

