IBM DB2 dialect plugin for sqlglot
Project description
ibmdb2-sqlglot-plugin
IBM DB2 dialect plugin for sqlglot — bidirectional transpilation between IBM DB2 and any SQL dialect.
Installation
pip install ibmdb2-sqlglot-plugin
Usage
After installing the package, the ibmdb2 dialect is available in sqlglot automatically — no extra imports needed:
import sqlglot
# Any dialect → IBM DB2
result = sqlglot.transpile("SELECT * FROM users WHERE id = 1", read="mysql", write="ibmdb2")[0]
# → SELECT * FROM `users` WHERE id = 1
# IBM DB2 → any dialect
result = sqlglot.transpile("$t = (SELECT id FROM users); SELECT * FROM $t AS t", read="ibmdb2", write="postgres")[0]
# → WITH t AS (SELECT id FROM users) SELECT * FROM t AS t
What the plugin does
@TODO
Development
## pip install uv # if uv does not exist locally
uv sync # install dependencies
uv run pytest # run all tests
License
APACHE LICENSE 2.0
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 ibmdb2_sqlglot_plugin-0.0.2.tar.gz.
File metadata
- Download URL: ibmdb2_sqlglot_plugin-0.0.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dcf7e942038cbdc55430d95c479caf76019e49418420d6af02981a0ddf10c09
|
|
| MD5 |
4cd3f703a5a0265aa575bf72d1de0fd5
|
|
| BLAKE2b-256 |
772c4a52a2b8d3e707b67ff58cda1383e22deaba868a41b0098aaa0d43154d75
|
File details
Details for the file ibmdb2_sqlglot_plugin-0.0.2-py3-none-any.whl.
File metadata
- Download URL: ibmdb2_sqlglot_plugin-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d0430a7135b53fbcac90997bb57749000e46fb78ab150b7259196af5fb76c0d
|
|
| MD5 |
4452dfd9e4eaca6b4b2fc965f1b49143
|
|
| BLAKE2b-256 |
c057965ac579f2d7b9920916dbc67ffac7187499a63e6b488357fd205d59b21c
|