Metadata-Version: 2.4
Name: oracle-sql-splitter
Version: 0.1.0
Summary: Split Oracle SQL and PL/SQL scripts into executable statements.
Author: Roman
Maintainer: Roman
License-Expression: MIT
Project-URL: Homepage, https://github.com/ob-server83/oracle-sql-splitter
Project-URL: Repository, https://github.com/ob-server83/oracle-sql-splitter
Project-URL: Issues, https://github.com/ob-server83/oracle-sql-splitter/issues
Project-URL: Changelog, https://github.com/ob-server83/oracle-sql-splitter/releases
Keywords: oracle,sql,plsql,splitter,parser
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# oracle-sql-splitter

Small Python library and CLI for splitting Oracle SQL and PL/SQL scripts into executable statements.

## Features

- Splits regular SQL statements terminated by `;`
- Keeps Oracle PL/SQL blocks together until a standalone `/`
- Skips common SQL*Plus directives such as `SET SERVEROUTPUT ON`
- Preserves comments and blank lines that belong to a statement
- Exposes both a Python API and a CLI
- Includes GitHub Actions for CI and PyPI publishing

## Install

```bash
pip install oracle-sql-splitter
```

## Python usage

```python
from oracle_sql_splitter import split_sql

sql = """
SET SERVEROUTPUT ON
CREATE TABLE demo (id NUMBER);
BEGIN
  NULL;
END;
/
"""

parts = split_sql(sql)
for part in parts:
    print("---")
    print(part)
```

## CLI usage

Split a file:

```bash
oracle-sql-splitter path/to/script.sql
```

Read from stdin:

```bash
type script.sql | oracle-sql-splitter --stdin
```

Print as JSON:

```bash
oracle-sql-splitter path/to/script.sql --json
```

## Development

```bash
python -m pip install -e .[dev]
pytest
python -m build
python -m twine check dist/*
```

## GitHub Actions

- `.github/workflows/ci.yml` runs tests and package build checks
- `.github/workflows/publish.yml` publishes to PyPI via trusted publishing on GitHub Releases

## Publish to PyPI

See `RELEASE.md` for the full release checklist.

Quick summary:

1. Confirm the package name `oracle-sql-splitter` is still available on PyPI, or rename it before the first release.
2. Bump `version` in `pyproject.toml`.
3. Build and validate distributions locally.
4. Publish to TestPyPI first if you want a dry run.
5. Publish to PyPI either manually with `twine` or by creating a GitHub release after configuring trusted publishing.
