{"id":24644,"library":"sql-compare","title":"sql-compare","description":"Compare SQL schemas and generate human-readable diffs. Version 0.2.0, released November 2024. Active development, monthly releases.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/Mergifyio/sql-compare","tags":["sql","schema","diff","comparison"],"install":[{"cmd":"pip install sql-compare","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Package uses underscore in module name.","wrong":"from sqlcompare import diff","symbol":"diff","correct":"from sql_compare import diff"},{"note":"Functions are at package level, not submodule.","wrong":"from sql_compare.diff import diff_files","symbol":"diff_files","correct":"from sql_compare import diff_files"}],"quickstart":{"code":"from sql_compare import diff\n\nschema1 = \"CREATE TABLE users (id INT, name TEXT);\"\nschema2 = \"CREATE TABLE users (id INT, name VARCHAR(255));\"\nprint(diff(schema1, schema2))","lang":"python","description":"Basic usage: compare two SQL schema strings and print the diff."},"warnings":[{"fix":"Use `get_diff()` for human-readable string output, or iterate over the list objects returned by `diff()`.","message":"In version 0.2.0, the return type of `diff()` changed from a string to a list of change objects. Code expecting a string will break.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Replace `get_diff(a, b)` with `str(diff(a, b))` or similar.","message":"The function `get_diff()` is deprecated in 0.2.0; use `diff()` or `diff_files()` instead.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Always pass string paths: `diff_files('schema1.sql', 'schema2.sql')`.","message":"`diff_files()` expects file paths, not file objects. Passing an open file handle will fail.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.2.0':14 '2024':17 'activ':18 'compar':3,4 'comparison':25 'develop':19 'diff':12,24 'generat':8 'human':10 'human-read':9 'month':20 'novemb':16 'readabl':11 'releas':15,21 'schema':6,23 'sql':2,5,22 'sql-compar':1 'version':13","created_at":"2026-05-01T08:14:10.977744+00:00","updated_at":"2026-05-01T08:14:10.977744+00:00","problems":[{"fix":"Install with `pip install sql-compare` and import with `from sql_compare import diff`.","cause":"The package is installed as 'sql-compare' but import uses underscore.","error":"ModuleNotFoundError: No module named 'sql_compare'"},{"fix":"Use `diff()` or `diff_files()` instead of `get_diff()`.","cause":"Function renamed or removed in newer version.","error":"AttributeError: module 'sql_compare' has no attribute 'get_diff'"},{"fix":"Pass a string file path: `diff_files('file1.sql', 'file2.sql')`.","cause":"Passed a file object to `diff_files()` instead of a file path.","error":"TypeError: expected str, bytes or os.PathLike object, not _io.TextIOWrapper"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.0","cli_name":"sql-compare","cli_version":"sh: 1: sql-compare: not found","type":"library","homepage":null,"github":"https://github.com/Mergifyio/sql-compare","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sql-compare/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}