quickdbd-cli 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/PKG-INFO +1 -1
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/pyproject.toml +1 -1
- quickdbd_cli-0.3.1/src/quickdbd_cli/__init__.py +1 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/agent.py +2 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/render.js +19 -7
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/syntax-reference.md +1 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/viewer.js +4 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/convert.py +5 -2
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/dbml.py +13 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/measure.py +2 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/model.py +1 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/parser.py +7 -1
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/tags.py +20 -7
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_convert.py +9 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_dbml.py +9 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_tags.py +42 -0
- quickdbd_cli-0.3.0/src/quickdbd_cli/__init__.py +0 -1
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/.gitignore +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/LICENSE +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/NOTICE +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/README.md +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/quickdbd-sample.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/finance.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/hr.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/inventory.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/marketing.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/qdbd.layout.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/examples/synthetic/sales.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/build_gallery.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/gen_font_metrics.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/gen_schema.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/gen_thumbnails.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/import_dbml_corpus.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/scripts/release.sh +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/__main__.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/Inter-Bold.ttf +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/Inter-Bold.woff2 +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/Inter-LICENSE.txt +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/Inter-Regular.ttf +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/Inter-Regular.woff2 +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/editor.js +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/elk-LICENSE.md +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/elk.bundled.js +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/font-metrics.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/assets/style.css +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/cli.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/dbt.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/diff.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/export.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/html.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/jsrt.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/layout.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/mcp.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/project.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/serve.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/share.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/src/quickdbd_cli/targets.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml/team.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/LICENSE +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/README.md +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/alias_of_duplicated_names.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/alias_of_duplicated_names.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/dep.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/dep.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_columns.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_columns.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_enum_field.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_enum_field.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_name.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_name.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_names.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_names.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_table_partial_injections.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_table_partial_injections.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/enum_as_default_column_value.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/enum_as_default_column_value.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/enum_name.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/enum_name.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/erroneous.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/erroneous.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/multiple_notes_in_table_group.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/multiple_notes_in_table_group.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_column_in_index.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_column_in_index.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_column_in_index_table_partial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_column_in_index_table_partial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_inline_ref_column_in_table.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_inline_ref_column_in_table.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_inline_ref_column_in_table_partial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/nonexisting_inline_ref_column_in_table_partial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/ref_validator.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/ref_validator.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/sticky_notes_validator.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/sticky_notes_validator.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/table_partial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/table_partial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/unknown_table_group_field.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/unknown_table_group_field.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/array_type.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/array_type.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/checks.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/checks.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_1_inline_1_element.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_1_inline_1_element.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_2_elements.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_2_elements.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_2_inlines.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/circular_ref_2_inlines.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/column_caller_type.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/column_caller_type.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/comment.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/comment.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/composite_pk.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/composite_pk.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/default_tables.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/default_tables.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_color.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_color.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_duplicate.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_duplicate.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_pipeline.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/dep_pipeline.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/enum_as_default_column_value.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/enum_as_default_column_value.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/enum_tables.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/enum_tables.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/erroneous.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/erroneous.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/general_schema.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/general_schema.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/header_color_tables.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/header_color_tables.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/index_table_partial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/index_table_partial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/index_tables.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/index_tables.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/metadata.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/metadata.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/metadata_errors.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/metadata_errors.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/multi_notes.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/multi_notes.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/multiline_string.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/multiline_string.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/negative_number.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/negative_number.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/note_normalize.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/note_normalize.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/note_normalize_with_top_empty_lines.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/note_normalize_with_top_empty_lines.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/old_undocumented_syntax.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/old_undocumented_syntax.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/primary_key.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/primary_key.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/project.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/project.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/ref_name_and_color_setting.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/ref_name_and_color_setting.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/ref_settings.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/ref_settings.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/referential_actions.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/referential_actions.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/self_referential_ref_in_tablepartial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/self_referential_ref_in_tablepartial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/sticky_notes.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/sticky_notes.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_element.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_element.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group_element.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group_element.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group_settings.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_group_settings.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_partial.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_partial.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_reappear_tablegroup.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_reappear_tablegroup.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_settings.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/table_settings.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/tablepartial_causing_circular_ref.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/tablepartial_causing_circular_ref.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/two_inline_refs.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/two_inline_refs.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/call_expression.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/call_expression.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/element_in_simple_body.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/element_in_simple_body.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/erroneous_setting.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/erroneous_setting.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/expression.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/expression.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/last_invalid_number.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/last_invalid_number.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/list_expression.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/list_expression.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/trailing_comments.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/trailing_comments.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/tuple_expression.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/parser/tuple_expression.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/checks.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/checks.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/complex_names.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/complex_names.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/dep.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/dep.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/enum.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/enum.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/invalid_args.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/invalid_args.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/public_schema.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/public_schema.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/redefined_note.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/redefined_note.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/ref_error_setting.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/ref_error_setting.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/ref_in_table.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/ref_in_table.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/schema_nested_tablegroup.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/schema_nested_tablegroup.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_group_settings.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_group_settings.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_partial_check.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_partial_check.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_partial_settings_general.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_partial_settings_general.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_settings_check.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_settings_check.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_settings_general.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/table_settings_general.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/wrong_sub_element_declarations.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/wrong_sub_element_declarations.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/wrong_table_partial_injection_syntax.dbml +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/validator/wrong_table_partial_injection_syntax.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/jaffle/LICENSE +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/jaffle/README.md +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/jaffle/catalog.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/jaffle/manifest.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/targets/cases.json +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_agent.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_dbml_pipeline.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_dbt.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_diff.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_gallery.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_mcp.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_packaging.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_parser.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_path.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_pipeline.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_render.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_select.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_serve.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_share.py +0 -0
- {quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/test_targets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: quickdbd-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Compile QuickDBD-syntax schema files into interactive HTML ER diagrams, with no table limit.
|
|
5
5
|
Project-URL: Homepage, https://github.com/MarkPhamm/quickdbd-cli
|
|
6
6
|
Author: Minh (Mark) Pham
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "quickdbd-cli"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Compile QuickDBD-syntax schema files into interactive HTML ER diagrams, with no table limit."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.1"
|
|
@@ -471,6 +471,8 @@ def describe_tables(ws: Workspace, args: dict) -> Result:
|
|
|
471
471
|
flags.append("auto")
|
|
472
472
|
if col["default"] is not None:
|
|
473
473
|
flags.append(f"default={col['default']}")
|
|
474
|
+
if col.get("tags"):
|
|
475
|
+
flags.append(f"tags {', '.join(col['tags'])}")
|
|
474
476
|
if col["type"] in enums:
|
|
475
477
|
vals = enums[col["type"]]
|
|
476
478
|
flags.append("enum(" + ", ".join(vals[:20]) + (", …" if len(vals) > 20 else "") + ")")
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
return set;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/* Visible columns of each table for a collapse mode: "full" | "keys" | "header". */
|
|
55
|
+
/* Visible columns of each table for a collapse mode: "full" | "keys" | "header". Tagged columns count as keys. */
|
|
56
56
|
function geometry(model, mode) {
|
|
57
57
|
var st = model.style, rel = mode === "keys" ? relatedColumns(model) : null, out = {};
|
|
58
58
|
model.tables.forEach(function (t) {
|
|
59
59
|
var cols = [];
|
|
60
60
|
if (mode !== "header") {
|
|
61
61
|
t.cols.forEach(function (c) {
|
|
62
|
-
if (mode === "full" || c.pk || c.fk || rel[t.id + "\u0000" + c.id]) cols.push(c);
|
|
62
|
+
if (mode === "full" || c.pk || c.fk || c.color || rel[t.id + "\u0000" + c.id]) cols.push(c);
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
var rows = {};
|
|
@@ -105,14 +105,22 @@
|
|
|
105
105
|
g.cols.forEach(function (c, i) {
|
|
106
106
|
var y = st.headerH + i * st.rowH, cy = y + st.rowH / 2, base = n(cy + st.rowSize * 0.36);
|
|
107
107
|
var weight = c.pk || c.fk ? ' font-weight="bold"' : "";
|
|
108
|
-
var color = c.pk ? C.pk : c.fk ? C.fk : C.text, rn = c.pk ? "rn rpk" : c.fk ? "rn rfk" : "rn";
|
|
108
|
+
var color = c.color || (c.pk ? C.pk : c.fk ? C.fk : C.text), rn = c.pk ? "rn rpk" : c.fk ? "rn rfk" : "rn";
|
|
109
109
|
out.push('<g class="r" data-c="' + esc(c.id) + '">');
|
|
110
|
+
// a tagged column: tinted row and a bar in the tag colour (a diff bar, drawn next, covers the bar)
|
|
111
|
+
if (c.color) {
|
|
112
|
+
out.push('<rect y="' + y + '" width="' + w + '" height="' + st.rowH + '" fill="' + c.color + '" fill-opacity=".1"/>');
|
|
113
|
+
out.push('<rect y="' + (y + 3) + '" width="3" height="' + (st.rowH - 6) + '" fill="' + c.color + '"/>');
|
|
114
|
+
}
|
|
110
115
|
out.push('<rect class="rb" y="' + y + '" width="' + w + '" height="' + st.rowH + '" fill="' + C.body + '" fill-opacity="0"/>');
|
|
111
116
|
var cstate = t.diff && t.diff.cols && t.diff.cols[c.id];
|
|
112
117
|
if (cstate) out.push('<rect y="' + (y + 3) + '" width="3" height="' + (st.rowH - 6) + '" fill="' + C[cstate] + '"/>');
|
|
113
|
-
out.push('<text class="' + rn + '" x="' + st.padX + '" y="' + base + '" fill="' + color + '"
|
|
114
|
-
st.rowSize + '"' + weight + ">" + esc(c.name) + "</text>");
|
|
118
|
+
out.push('<text class="' + rn + '" x="' + st.padX + '" y="' + base + '" fill="' + color + '"' + (c.color ? ' style="fill:' + c.color + '"' : "") +
|
|
119
|
+
' font-family="' + FONT + '" font-size="' + st.rowSize + '"' + weight + ">" + esc(c.name) + "</text>");
|
|
115
120
|
if (docMarks && c.doc) out.push(docMark(st.padX, cy + st.rowSize * 0.36 + 2.5, c.nameW, color));
|
|
121
|
+
if (c.tags && c.tags.indexOf("removed") >= 0) {
|
|
122
|
+
out.push('<line x1="' + st.padX + '" y1="' + n(cy) + '" x2="' + n(st.padX + c.nameW) + '" y2="' + n(cy) + '" stroke="' + color + '" stroke-width="1.2"/>');
|
|
123
|
+
}
|
|
116
124
|
var bx = st.padX + c.nameW + 6;
|
|
117
125
|
c.badges.forEach(function (b) {
|
|
118
126
|
var bh = st.badgeSize + 5;
|
|
@@ -337,11 +345,12 @@
|
|
|
337
345
|
}, g(0, HEADH + i * ROWH, w, ROWH)));
|
|
338
346
|
var base = "shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;overflow=hidden;html=0;";
|
|
339
347
|
var flags = c.badges.map(function (x) { return x.t; }).join(" ");
|
|
348
|
+
var fs = (c.pk ? 5 : c.fk ? 1 : 0) | (c.tags && c.tags.indexOf("removed") >= 0 ? 8 : 0); // bold, underline, strike
|
|
340
349
|
cells.push(cell({ id: id(), value: key, vertex: "1", parent: rid, style: base + "fontStyle=1;fontColor=#2b5797;align=center;fontSize=11;" },
|
|
341
350
|
g(0, 0, KEYW, ROWH)));
|
|
342
351
|
cells.push(cell({
|
|
343
352
|
id: id(), value: c.name + (flags ? " [" + flags + "]" : "") + (c.type ? " : " + c.type : ""), vertex: "1", parent: rid,
|
|
344
|
-
style: base + "align=left;spacingLeft=6;fontSize=12;" + (
|
|
353
|
+
style: base + "align=left;spacingLeft=6;fontSize=12;" + (fs ? "fontStyle=" + fs + ";" : "") + (c.color ? "fontColor=" + c.color + ";" : ""),
|
|
345
354
|
}, g(KEYW, 0, w - KEYW, ROWH)));
|
|
346
355
|
});
|
|
347
356
|
});
|
|
@@ -407,7 +416,10 @@
|
|
|
407
416
|
else if (method === "group") ok = re.test(t.group || "") || (t.group || "").toLowerCase().indexOf(pat.toLowerCase() + "/") === 0;
|
|
408
417
|
else if (method === "file") ok = re.test(t.file || "") || re.test((t.file || "").split("/").pop());
|
|
409
418
|
else if (method === "col" || method === "column") ok = t.cols.some(function (c) { return re.test(c.name); });
|
|
410
|
-
else if (method === "tag")
|
|
419
|
+
else if (method === "tag") {
|
|
420
|
+
var has = function (x) { return re.test(x); };
|
|
421
|
+
ok = (t.tags || []).some(has) || t.cols.some(function (c) { return (c.tags || []).some(has); });
|
|
422
|
+
}
|
|
411
423
|
else if (method === "diff" || method === "state") {
|
|
412
424
|
var ds = t.diff && t.diff.state, want = pat.toLowerCase();
|
|
413
425
|
ok = !!ds && (want === "modified" || want === "*" || want === ds || (want === "new" && ds === "added"));
|
|
@@ -78,6 +78,7 @@ Declare a relationship once, in either direction.
|
|
|
78
78
|
- `#` starts a comment, except inside double quotes. Comment lines directly above a table or column, plus a comment at the end of its line, become its documentation.
|
|
79
79
|
- Tags give tables a role and a header colour: `# @tag: gold, pii` above a table. Names like `dim_`, `fct_`, `stg_`, `int_`, `raw_` are tagged automatically.
|
|
80
80
|
- `# @color gold #b8860b` sets a tag's colour (anywhere in any file).
|
|
81
|
+
- Columns take tags too, on or above the column line: `discount decimal # @tag: added`. The row is tinted in the tag's colour; `added` is green, `removed` is red and struck through. Use them to mark proposed column changes for review.
|
|
81
82
|
|
|
82
83
|
## Settings and layout sections
|
|
83
84
|
|
|
@@ -552,6 +552,10 @@
|
|
|
552
552
|
if (c.pk) tags.push('<span class="tag pk">PK</span>');
|
|
553
553
|
if (c.fk) tags.push('<span class="tag fk">FK</span>');
|
|
554
554
|
c.badges.forEach(function (b) { tags.push('<span class="tag">' + Q.esc(b.t) + "</span>"); });
|
|
555
|
+
(c.tags || []).forEach(function (g) {
|
|
556
|
+
var tc = (S.model.tags || []).filter(function (x) { return x.name === g; })[0];
|
|
557
|
+
tags.push('<a class="ttag" data-tag="' + Q.esc(g) + '" style="background:' + Q.esc(tc ? tc.color : "#2b5797") + '">' + Q.esc(g) + "</a>");
|
|
558
|
+
});
|
|
555
559
|
out.push('<tr><td class="cn">' + Q.esc(c.name) + " " + tags.join("") + (c.doc ? '<div class="cd">' + Q.esc(c.doc) + "</div>" : "") +
|
|
556
560
|
'</td><td class="ct">' + Q.esc(c.type) + "</td></tr>");
|
|
557
561
|
});
|
|
@@ -82,7 +82,7 @@ def canonical(schema: Schema, lost: set[tuple]) -> dict:
|
|
|
82
82
|
continue
|
|
83
83
|
col = {
|
|
84
84
|
"type": c.type or "", "pk": c.pk, "unique": c.unique, "index": c.index, "nullable": c.nullable,
|
|
85
|
-
"identity": c.identity, "default": _norm_default(c.default), "doc": _doc(c.comments),
|
|
85
|
+
"identity": c.identity, "default": _norm_default(c.default), "doc": _doc(c.comments), "tags": c.tags,
|
|
86
86
|
} # fmt: skip
|
|
87
87
|
for k in list(col):
|
|
88
88
|
if ("col", t.name, c.name, k) in lost:
|
|
@@ -202,7 +202,8 @@ class _DbmlWriter:
|
|
|
202
202
|
self.res.lost.add(("col", t.name, c.name, "type"))
|
|
203
203
|
typ = "unknown"
|
|
204
204
|
typ = typ if _DBML_TYPE.fullmatch(typ) else _dbml_name(typ)
|
|
205
|
-
|
|
205
|
+
tags = f" // @tag: {', '.join(c.tags)}" if c.tags else ""
|
|
206
|
+
out.append(f" {_dbml_name(c.name)} {typ}" + (f" [{', '.join(settings)}]" if settings else "") + tags)
|
|
206
207
|
if indexed:
|
|
207
208
|
out += ["", " indexes {"] + [f" {_dbml_name(n)}" for n in indexed] + [" }"]
|
|
208
209
|
if t.comments:
|
|
@@ -367,6 +368,8 @@ class _QuickdbdWriter:
|
|
|
367
368
|
self.res.lost.add(("col", t.name, c.name, "default"))
|
|
368
369
|
c = dataclasses.replace(c, default=None)
|
|
369
370
|
out += [f"# {x}" for x in c.comments if x.strip()]
|
|
371
|
+
if c.tags:
|
|
372
|
+
out.append(f"# @tag: {', '.join(c.tags)}")
|
|
370
373
|
out.append(_quickdbd_column(c, self.fks.get((t.id, c.id), [])))
|
|
371
374
|
return out
|
|
372
375
|
|
|
@@ -1131,6 +1131,7 @@ class _Interpreter:
|
|
|
1131
1131
|
elif s.key == "note" and s.value and s.value[0].kind in ("str", "quoted"):
|
|
1132
1132
|
v = s.value[0]
|
|
1133
1133
|
col.comments = _doc_lines(_normalize_note(v.value) if v.multiline else v.value)
|
|
1134
|
+
self._col_tags(col)
|
|
1134
1135
|
t.columns[col.id] = col
|
|
1135
1136
|
for ix in indexes:
|
|
1136
1137
|
missing = [c for c in ix.columns if encode(c) not in t.columns]
|
|
@@ -1291,6 +1292,18 @@ class _Interpreter:
|
|
|
1291
1292
|
target[:0] = [x for x in split_tags(m.group(2)) if x not in target]
|
|
1292
1293
|
line -= 1
|
|
1293
1294
|
|
|
1295
|
+
def _col_tags(self, col: Column) -> None:
|
|
1296
|
+
"""`// @tag:` at the end of the column's line, or on comment lines right above it."""
|
|
1297
|
+
lines = [col.line]
|
|
1298
|
+
line = col.line - 1
|
|
1299
|
+
while line in self.comments and line not in self.code_lines:
|
|
1300
|
+
lines.append(line)
|
|
1301
|
+
line -= 1
|
|
1302
|
+
for line in reversed(lines):
|
|
1303
|
+
m = TAG_RE.match(self.comments.get(line, ""))
|
|
1304
|
+
if m and not m.group(1).lower().startswith("dbt"):
|
|
1305
|
+
col.tags += [x for x in split_tags(m.group(2)) if x not in col.tags]
|
|
1306
|
+
|
|
1294
1307
|
def colors(self) -> None:
|
|
1295
1308
|
first_code = min(self.code_lines, default=0)
|
|
1296
1309
|
self.fp.general_comments = [
|
|
@@ -475,7 +475,13 @@ class _FileParser:
|
|
|
475
475
|
if is_virtual(ident):
|
|
476
476
|
return Column(VIRTUAL_FIELD, "", e.line, virtual=True)
|
|
477
477
|
tokens = [tokens[0]] + self._merge_paren_tokens(tokens[1:], e.line)
|
|
478
|
-
col = Column(ident, name, e.line
|
|
478
|
+
col = Column(ident, name, e.line)
|
|
479
|
+
for c in e.comments:
|
|
480
|
+
m = TAG_RE.match(c)
|
|
481
|
+
if m and not m.group(1).lower().startswith("dbt"):
|
|
482
|
+
col.tags += [t for t in split_tags(m.group(2)) if t not in col.tags]
|
|
483
|
+
else:
|
|
484
|
+
col.comments.append(c)
|
|
479
485
|
fk_at = -1
|
|
480
486
|
d = 0
|
|
481
487
|
while d + 1 < len(tokens):
|
|
@@ -8,10 +8,15 @@ A table's tags come from the first source that has any:
|
|
|
8
8
|
|
|
9
9
|
The header takes the colour of the table's first tag. ``# @color TAG #hex`` overrides the defaults, and a DBML
|
|
10
10
|
``headercolor`` beats both.
|
|
11
|
+
|
|
12
|
+
Columns take tags too (``# @tag: added`` on or above the column line), which mark the row in the first tag's colour;
|
|
13
|
+
``added`` and ``removed`` default to green and red, for hand-marked proposed changes.
|
|
11
14
|
"""
|
|
12
15
|
|
|
13
16
|
from __future__ import annotations
|
|
14
17
|
|
|
18
|
+
from collections.abc import Iterable
|
|
19
|
+
|
|
15
20
|
from .model import Schema, Table
|
|
16
21
|
|
|
17
22
|
# tag -> name prefixes (matched as `prefix_...` or `PrefixName`)
|
|
@@ -23,13 +28,16 @@ NAME_TAGS: list[tuple[str, tuple[str, ...]]] = [
|
|
|
23
28
|
("raw", ("raw", "src")),
|
|
24
29
|
]
|
|
25
30
|
|
|
26
|
-
#
|
|
31
|
+
# Table-role defaults avoid the diff colours (green = added, amber = changed) and the untagged blue; `added` and
|
|
32
|
+
# `removed` are meant for columns, and use the diff green on purpose.
|
|
27
33
|
DEFAULT_COLORS = {
|
|
28
34
|
"dim": "#00838f",
|
|
29
35
|
"fact": "#c2185b",
|
|
30
36
|
"staging": "#546e7a",
|
|
31
37
|
"intermediate": "#7b1fa2",
|
|
32
38
|
"raw": "#6d4c41",
|
|
39
|
+
"added": "#2e7d32",
|
|
40
|
+
"removed": "#c62828",
|
|
33
41
|
}
|
|
34
42
|
PALETTE = ["#0277bd", "#4527a0", "#00695c", "#ad1457", "#827717", "#bf360c", "#37474f", "#283593", "#5d4037"]
|
|
35
43
|
|
|
@@ -65,9 +73,9 @@ def table_tags(t: Table) -> list[str]:
|
|
|
65
73
|
return list(t.dbt_tags)
|
|
66
74
|
|
|
67
75
|
|
|
68
|
-
def tag_colors(schema: Schema,
|
|
76
|
+
def tag_colors(schema: Schema, tag_lists: Iterable[list[str]]) -> dict[str, str]:
|
|
69
77
|
"""Colour of every tag in use: explicit @color, else the default, else the next palette colour (by name)."""
|
|
70
|
-
used = sorted({tag for tags in
|
|
78
|
+
used = sorted({tag for tags in tag_lists for tag in tags})
|
|
71
79
|
out: dict[str, str] = {}
|
|
72
80
|
i = 0
|
|
73
81
|
for tag in used:
|
|
@@ -82,17 +90,22 @@ def tag_colors(schema: Schema, tags_by_table: dict[str, list[str]]) -> dict[str,
|
|
|
82
90
|
|
|
83
91
|
|
|
84
92
|
def annotate(schema: Schema, tables: list[dict]) -> list[dict]:
|
|
85
|
-
"""Add ``tags`` and ``color`` to each table dict of the model JSON; return the
|
|
93
|
+
"""Add ``tags`` and ``color`` to each table dict of the model JSON, and ``color`` to tagged columns; return the
|
|
94
|
+
legend (count = tables carrying the tag, on the table or on a column)."""
|
|
86
95
|
by_id = {t["id"]: table_tags(schema.tables[t["id"]]) for t in tables}
|
|
87
|
-
|
|
96
|
+
col_tags = {t["id"]: [g for c in t["cols"] for g in c.get("tags", [])] for t in tables}
|
|
97
|
+
colors = tag_colors(schema, [*by_id.values(), *col_tags.values()])
|
|
88
98
|
counts: dict[str, int] = {}
|
|
89
99
|
for t in tables:
|
|
90
100
|
tags = by_id[t["id"]]
|
|
91
101
|
if tags:
|
|
92
102
|
t["tags"] = tags
|
|
93
103
|
t["color"] = colors[tags[0]]
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
for c in t["cols"]:
|
|
105
|
+
if c.get("tags"):
|
|
106
|
+
c["color"] = colors[c["tags"][0]]
|
|
107
|
+
for tag in dict.fromkeys(tags + col_tags[t["id"]]):
|
|
108
|
+
counts[tag] = counts.get(tag, 0) + 1
|
|
96
109
|
own = schema.tables[t["id"]].color # DBML headercolor
|
|
97
110
|
if own:
|
|
98
111
|
t["color"] = own
|
|
@@ -146,6 +146,15 @@ def test_docs_and_tags_round_trip():
|
|
|
146
146
|
assert t.columns["Id"].comments == ["the key"]
|
|
147
147
|
|
|
148
148
|
|
|
149
|
+
def test_column_tags_round_trip():
|
|
150
|
+
text = "a\n-\nid PK int\nnew int # @tag: added\n# @tag: removed, pii\nold int\n"
|
|
151
|
+
dbml = conv.convert([("s.txt", "s.txt", text)], "dbml", split_groups=False).files["s.dbml"]
|
|
152
|
+
assert " new int // @tag: added\n" in dbml
|
|
153
|
+
back = conv.convert([("s.dbml", "s.dbml", dbml)], "quickdbd", split_groups=False).files["s.txt"]
|
|
154
|
+
cols = compile_sources([("s.txt", back)]).tables["a"].columns
|
|
155
|
+
assert cols["new"].tags == ["added"] and cols["old"].tags == ["removed", "pii"]
|
|
156
|
+
|
|
157
|
+
|
|
149
158
|
def test_already_in_target_syntax_is_copied():
|
|
150
159
|
res = conv.convert([("t.dbml", "t.dbml", TEAM)], "dbml", split_groups=False)
|
|
151
160
|
assert res.files == {"t.dbml": TEAM}
|
|
@@ -269,6 +269,15 @@ Table a [headercolor: #0A0] {
|
|
|
269
269
|
assert fp.colors["hot"][0] == "#ff0000"
|
|
270
270
|
|
|
271
271
|
|
|
272
|
+
def test_column_tags_from_comments():
|
|
273
|
+
text = "Table a {\n id int // @tag: added\n // @tag: removed\n // @dbt-tags: x\n old int [note: 'gone']\n}\n"
|
|
274
|
+
_, schema = compile_dbml(text)
|
|
275
|
+
assert errors(schema) == []
|
|
276
|
+
cols = schema.tables["a"].columns
|
|
277
|
+
assert cols["id"].tags == ["added"]
|
|
278
|
+
assert cols["old"].tags == ["removed"] and cols["old"].comments == ["gone"]
|
|
279
|
+
|
|
280
|
+
|
|
272
281
|
def test_optional_relationship_operators():
|
|
273
282
|
text = "Table a {\n id int [pk]\n}\nTable b {\n a_id int\n}\nRef: b.a_id >? a.id\n"
|
|
274
283
|
_, schema = compile_dbml(text)
|
|
@@ -165,6 +165,48 @@ def test_diff_colour_wins_over_tag():
|
|
|
165
165
|
assert b["color"] == DEFAULT_COLORS["dim"] and "#2e7d32" in svg and DEFAULT_COLORS["dim"] not in svg
|
|
166
166
|
|
|
167
167
|
|
|
168
|
+
COLUMNS = """# @color pii #ff9800
|
|
169
|
+
orders
|
|
170
|
+
-
|
|
171
|
+
id PK int
|
|
172
|
+
# The discount.
|
|
173
|
+
# @tag: added
|
|
174
|
+
discount decimal
|
|
175
|
+
legacy varchar # @tag: removed
|
|
176
|
+
email varchar # @tag: PII
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def test_column_tags():
|
|
181
|
+
s = compile_text(COLUMNS)
|
|
182
|
+
cols = s.tables["orders"].columns
|
|
183
|
+
assert cols["discount"].tags == ["added"] and cols["discount"].comments == ["The discount."]
|
|
184
|
+
assert cols["legacy"].tags == ["removed"] and cols["legacy"].comments == []
|
|
185
|
+
assert s.diagnostics == []
|
|
186
|
+
m = model_json(s)
|
|
187
|
+
c = {c["name"]: c for c in m["tables"][0]["cols"]}
|
|
188
|
+
assert c["discount"]["color"] == DEFAULT_COLORS["added"] == "#2e7d32"
|
|
189
|
+
assert c["legacy"]["color"] == DEFAULT_COLORS["removed"]
|
|
190
|
+
assert c["email"]["tags"] == ["pii"] and c["email"]["color"] == "#ff9800"
|
|
191
|
+
assert "tags" not in c["id"] and "color" not in c["id"]
|
|
192
|
+
assert "tags" not in m["tables"][0] # column tags don't tag (or colour) the table
|
|
193
|
+
assert {g["name"]: g["count"] for g in m["tags"]} == {"added": 1, "pii": 1, "removed": 1}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def test_column_tags_render_select_and_keys_mode():
|
|
197
|
+
m = model_json(compile_text(COLUMNS + "\nother\n-\nid int\n"))
|
|
198
|
+
rt = runtime()
|
|
199
|
+
rt.load("render.js")
|
|
200
|
+
assert rt.call("qdbdSelect", m, "tag:removed") == ["orders"]
|
|
201
|
+
pos = {"orders": [0, 0], "other": [300, 0]}
|
|
202
|
+
svg = render_svg(m, pos, embed_font=False)
|
|
203
|
+
assert 'fill="#c62828" fill-opacity=".1"' in svg and 'stroke="#c62828"' in svg # tinted row, struck name
|
|
204
|
+
keys = render_svg(m, pos, mode="keys", embed_font=False)
|
|
205
|
+
assert ">legacy<" in keys and ">email<" in keys # tagged columns stay visible with keys only
|
|
206
|
+
xml = render_drawio(m, pos)
|
|
207
|
+
assert "fontStyle=8;fontColor=#c62828;" in xml and "fontColor=#2e7d32;" in xml
|
|
208
|
+
|
|
209
|
+
|
|
168
210
|
def test_dbt_import_writes_dbt_tags(tmp_path):
|
|
169
211
|
def node(uid, name, tags=None, config_tags=None):
|
|
170
212
|
return {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_columns.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_columns.json
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_enum_field.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_enum_field.json
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_name.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_name.json
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_names.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/duplicate_names.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/sticky_notes_validator.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/binder/sticky_notes_validator.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/array_type.dbml
RENAMED
|
File without changes
|
{quickdbd_cli-0.3.0 → quickdbd_cli-0.3.1}/tests/fixtures/dbml-ref/interpreter/array_type.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|