Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibmdb2_sqlglot_plugin-0.0.3.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibmdb2_sqlglot_plugin-0.0.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ibmdb2_sqlglot_plugin-0.0.3.tar.gz.

File metadata

  • Download URL: ibmdb2_sqlglot_plugin-0.0.3.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ibmdb2_sqlglot_plugin-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8266a47cede133d6f6081074826c6d71525b49b64002b07a7f258a2429c1d663
MD5 8b4a56b07881c1cc9066e18385e1ab1f
BLAKE2b-256 bfd9c1f571dfc7a9d740849033f8bdbdd494e5027d1dd0b1d9cf8c258172a2c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibmdb2_sqlglot_plugin-0.0.3.tar.gz:

Publisher: publish-pypi.yml on Salfiii/ibmdb2-sqlglot-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ibmdb2_sqlglot_plugin-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ibmdb2_sqlglot_plugin-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d60461b795c14db4fd53565e5a677cc01f43b4964769555c3a3a63e5294f1c1
MD5 6bf78f8ce507e9411bb998b38547f20f
BLAKE2b-256 9c187df659e24422d83e8f18a91fc38d6f0c1c708314dfa6272fa0310449684c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibmdb2_sqlglot_plugin-0.0.3-py3-none-any.whl:

Publisher: publish-pypi.yml on Salfiii/ibmdb2-sqlglot-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page