Skip to content

feat: adds name shortening for relations & temp tables, test timezone handling #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

clohl
Copy link

@clohl clohl commented May 6, 2025

Fixes:

  • timezone failures in round trip tests caused by locale - adds TZ normalization to avoid false failures
  • conftest.py: drop_all_tables fails due to sqlalchemy dropping dependencies out of order. Avoids test failure by accepting that this may happen with a try/catch and notifying the developer.

Features:

  • Add new model_config option: shorten_temp_table_names: When true, long temp names (table, or relation table) will be truncated at 30 chars and appended with the MD5 hex digest of the name to ensure uniqueness of the name. These are not human readable. This is helpful especially for rel tables or table names that are close to the 2^6 char limit.

  • Add new model_config option: shorten_rel_table_names: When true, long relation table names (for nested tags you can wind up with very long names even on simple table names) will be trimmed to the nearest word. For instance if max_len is set to 20, the relation name table_foo_table_bar_baz would be trimmed to table_foo_table_bar. If the name is not unique, the first 8 characters of the table name MD5 hex digest will be appended: table_foo_12345ABC. This attempts to create human readable and usable names which are still unique and reflective of the relations.

In most cases these changes will prevent length based table creation failures without modifying the XSD schema. This is helpful when the schema is not under the developer's control (e.g. provided by standards committee or other 3rd party).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant