Skip to main content

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

sql_compare-0.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

sql_compare-0.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

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

Hashes for sql_compare-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73f934f003e564eab2c450d5abae169f9fc568769c74d1d9e5fb68cf4a55385a
MD5 6fb8c532284f0e69f06f332fe449464c
BLAKE2b-256 343583afcc2da62fbd54875ff0ada406cebc4ebc976df52d68b01fbd9d8190e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_compare-0.2.0.tar.gz:

Publisher: release.yml on Mergifyio/sql-compare

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

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

Hashes for sql_compare-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ed406aca2b1423eb6629dfbbb08d3cca8a99c2e3704408c8f1ebe10757c7a8c
MD5 14db48226d38e893d257ea9ff0126ecd
BLAKE2b-256 098c6cf88af31039e29982a830d4e2e2a976c4daf8dabdec39287d062adeae56

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_compare-0.2.0-py3-none-any.whl:

Publisher: release.yml on Mergifyio/sql-compare

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