Compare SQL schemas
Project description
SQL Compare
Compare SQL schemas.
This package allows to compare two SQL files (or strings) to know whether their statements are the same or not. The comparison doesn't care about the order of the columns in a table or the order of the values in an enumerator. It also excludes irrelevant data like comments.
Its main usage is to compare the schemas of two databases (e.g. staging and production). See this blog post that tells about the creation of the package.
Installation
$ pip install sql-compare
Usage
Compare two SQL schemas using strings.
import sql_compare
assert sql_compare.compare(first_schema, second_schema)
Compare two SQL schemas using files.
import pathlib
import sql_compare
first_schema = pathlib.Path("/path/to/schema.sql")
second_schema = pathlib.Path("/path/to/other/schema.sql")
assert sql_compare.compare_files(first_schema, second_schema)
Dependencies
SQL Compare relies on sqlparse
to parse SQL statements.
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
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 sql_compare-0.2.0.tar.gz.
File metadata
- Download URL: sql_compare-0.2.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73f934f003e564eab2c450d5abae169f9fc568769c74d1d9e5fb68cf4a55385a
|
|
| MD5 |
6fb8c532284f0e69f06f332fe449464c
|
|
| BLAKE2b-256 |
343583afcc2da62fbd54875ff0ada406cebc4ebc976df52d68b01fbd9d8190e4
|
Provenance
The following attestation bundles were made for sql_compare-0.2.0.tar.gz:
Publisher:
release.yml on Mergifyio/sql-compare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sql_compare-0.2.0.tar.gz -
Subject digest:
73f934f003e564eab2c450d5abae169f9fc568769c74d1d9e5fb68cf4a55385a - Sigstore transparency entry: 944512318
- Sigstore integration time:
-
Permalink:
Mergifyio/sql-compare@de33bf804fa7900b1ef35246931ba11aecd59682 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de33bf804fa7900b1ef35246931ba11aecd59682 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sql_compare-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sql_compare-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.8 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 |
6ed406aca2b1423eb6629dfbbb08d3cca8a99c2e3704408c8f1ebe10757c7a8c
|
|
| MD5 |
14db48226d38e893d257ea9ff0126ecd
|
|
| BLAKE2b-256 |
098c6cf88af31039e29982a830d4e2e2a976c4daf8dabdec39287d062adeae56
|
Provenance
The following attestation bundles were made for sql_compare-0.2.0-py3-none-any.whl:
Publisher:
release.yml on Mergifyio/sql-compare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sql_compare-0.2.0-py3-none-any.whl -
Subject digest:
6ed406aca2b1423eb6629dfbbb08d3cca8a99c2e3704408c8f1ebe10757c7a8c - Sigstore transparency entry: 944512323
- Sigstore integration time:
-
Permalink:
Mergifyio/sql-compare@de33bf804fa7900b1ef35246931ba11aecd59682 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@de33bf804fa7900b1ef35246931ba11aecd59682 -
Trigger Event:
release
-
Statement type: