Split Oracle SQL and PL/SQL scripts into executable statements.
Project description
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
pip install oracle-sql-splitter
Python usage
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:
oracle-sql-splitter path/to/script.sql
Read from stdin:
type script.sql | oracle-sql-splitter --stdin
Print as JSON:
oracle-sql-splitter path/to/script.sql --json
Development
python -m pip install -e .[dev]
pytest
python -m build
python -m twine check dist/*
GitHub Actions
.github/workflows/ci.ymlruns tests and package build checks.github/workflows/publish.ymlpublishes to PyPI via trusted publishing on GitHub Releases
Publish to PyPI
See RELEASE.md for the full release checklist.
Quick summary:
- Confirm the package name
oracle-sql-splitteris still available on PyPI, or rename it before the first release. - Bump
versioninpyproject.toml. - Build and validate distributions locally.
- Publish to TestPyPI first if you want a dry run.
- Publish to PyPI either manually with
twineor by creating a GitHub release after configuring trusted publishing.
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 oracle_sql_splitter-0.1.0.tar.gz.
File metadata
- Download URL: oracle_sql_splitter-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
002f37861a4bd14c15f7b018d4ed4281d7a157f993a13c806c3fb50110588192
|
|
| MD5 |
c7e234bc997d6f32d48e03d5aa6d7110
|
|
| BLAKE2b-256 |
c0df746af6ae22010ea6716434e0563fd2363603eb9caeadd6b0ffb5088853e8
|
Provenance
The following attestation bundles were made for oracle_sql_splitter-0.1.0.tar.gz:
Publisher:
publish.yml on ob-server83/oracle-sql-splitter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oracle_sql_splitter-0.1.0.tar.gz -
Subject digest:
002f37861a4bd14c15f7b018d4ed4281d7a157f993a13c806c3fb50110588192 - Sigstore transparency entry: 1201242027
- Sigstore integration time:
-
Permalink:
ob-server83/oracle-sql-splitter@e1178b18d1f37ac45a538d5855b6927566a35f16 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ob-server83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1178b18d1f37ac45a538d5855b6927566a35f16 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oracle_sql_splitter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oracle_sql_splitter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ed4fab702d5fba76dffac773ef23dacb15138072825ebf04dde740855feb4bb
|
|
| MD5 |
edcbeed019dd7919ba33cac83d57ff52
|
|
| BLAKE2b-256 |
fdc7eb752d8100e1c519fad105b4b11a4a24f9edca0d012e99928e62c85d5ef9
|
Provenance
The following attestation bundles were made for oracle_sql_splitter-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ob-server83/oracle-sql-splitter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oracle_sql_splitter-0.1.0-py3-none-any.whl -
Subject digest:
1ed4fab702d5fba76dffac773ef23dacb15138072825ebf04dde740855feb4bb - Sigstore transparency entry: 1201242031
- Sigstore integration time:
-
Permalink:
ob-server83/oracle-sql-splitter@e1178b18d1f37ac45a538d5855b6927566a35f16 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ob-server83
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1178b18d1f37ac45a538d5855b6927566a35f16 -
Trigger Event:
release
-
Statement type: