Skip to content

v0.16.0

Choose a tag to compare

@FabianClemenz FabianClemenz released this 26 Oct 09:57
Immutable release. Only release title and notes can be modified.
decf971

erdify 0.16.0 locks the contract ahead of 1.0: a versioned JSON schema, a written stability policy, and a narrower, fully documented Python API. CLI users need no changes; Python API callers, see the breaking changes below.

Changed — breaking

  • The public Python API is now defined and narrowed ahead of 1.0 (#195).
    Only the names in erdify.__all__ are public; the CLI is unaffected.
    • Options after the first argument are now keyword-only on
      parse_models_directory, ASTDatabaseParser and SqlSchemaParser, and
      after enums on the generate_* functions and the generator classes.
      parse_models_directory(path, ["Base*"]) becomes
      parse_models_directory(path, exclude_patterns=["Base*"]).
    • Parser state is now private: ASTDatabaseParser.entities, .enums,
      .all_classes, .file_trees, .candidate_file_count and
      SqlSchemaParser.entities / .enums gained a _ prefix. Use the values
      returned by parse_all_models() / parse() instead.

Added

  • New documentation page Stability & Versioning. It defines which surfaces
    are covered by semver: CLI flags, exit codes, [tool.erdify] keys,
    pre-commit hook ids, the Python API and the JSON schema. It also states the
    policies for diagram output changes, deprecations, Python version support and
    the sqlglot range. Exit codes 0/1/2 are documented there for the
    first time, including that a file which fails to parse is skipped with an
    error on stderr rather than failing the run.
  • SqlSchemaParser, MermaidGenerator and the generate_mermaid,
    generate_json and generate_html functions are now documented, together
    with a "What is public" section in the CLI & Python API page.
  • Every public class and function now has a Google-style docstring covering
    its parameters, return value and raised errors, and EntityInfo,
    FieldInfo and EnumInfo document each field (e.g. foreign_table is
    "table.column", the allowed relationship types and source values).
  • SqlDependencyError is exported from erdify, so callers of
    SqlSchemaParser can catch it without importing an internal module.
  • --format json output now starts with a "schema_version": 1 key, so
    downstream tools can detect the document shape. Adding keys never bumps it;
    removing or renaming a key, or changing a value's type, bumps it and ships
    only in a major release. The Output Formats page now documents every key, its
    type and nullability, plus these compatibility rules. The version is also
    available as erdify.JSON_SCHEMA_VERSION.

Full changelog: v0.15.0...v0.16.0