### Example DBML output generation Source: https://github.com/makecodes/django-dbml/blob/main/README.md Command to generate DBML for the 'library' app and set the project name to 'Library'. ```bash python manage.py dbml library --add_project_name "Library" ``` -------------------------------- ### Install django-dbml Source: https://github.com/makecodes/django-dbml/blob/main/README.md Install the django-dbml package using pip. ```bash pip install django-dbml ``` -------------------------------- ### Example DBML schema structure Source: https://github.com/makecodes/django-dbml/blob/main/README.md Illustrative DBML output showing project definition, table structure, and a reference. ```dbml Project "Library" { database_type: 'PostgreSQL' Note: '''Generated from Django models. Last Updated At 03-30-2026 02:15PM UTC''' } Table library.Book { title char [not null] author_id bigint [not null] } ref: library.Book.author_id > library.Author.id ``` -------------------------------- ### Sync Dependencies with Custom Cache Directory Source: https://github.com/makecodes/django-dbml/blob/main/docs/development.md Installs project dependencies using a custom cache directory for UV. This is useful when the default cache location is inaccessible. ```bash UV_CACHE_DIR=.uv-cache make sync ``` -------------------------------- ### Generate DBML for all installed models Source: https://github.com/makecodes/django-dbml/blob/main/README.md Run the django-dbml management command to generate DBML for all models in your project. ```bash python manage.py dbml ``` -------------------------------- ### Bootstrap Project Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Run this command to synchronize dependencies and set up the project environment. ```bash make sync ``` -------------------------------- ### Build Package Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Build the project package for distribution. ```bash make build ``` -------------------------------- ### Recommended Production Release Flow Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Follow these steps for a recommended production release, including tagging and pushing. ```bash make test make lint make build git tag 1.1.2 git push origin 1.1.2 ``` -------------------------------- ### Add project metadata to DBML Source: https://github.com/makecodes/django-dbml/blob/main/README.md Include project name and notes, and specify an output file for the DBML schema. ```bash python manage.py dbml \ --add_project_name "Commerce Platform" \ --add_project_notes "Generated from production models." \ --output_file schema.dbml ``` -------------------------------- ### Pre-release Local Checks Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Before releasing locally, run tests, lint checks, and build the package. ```bash make test make lint make build ``` -------------------------------- ### Group and color tables by app in DBML Source: https://github.com/makecodes/django-dbml/blob/main/README.md Organize the DBML output by grouping tables by their app and coloring them based on the app using --group_by_app and --color_by_app options. ```bash python manage.py dbml --group_by_app --color_by_app ``` -------------------------------- ### Run Unit Tests Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Execute the project's unit tests to ensure code quality and functionality. ```bash make test ``` -------------------------------- ### Generate DBML with project name Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate the DBML schema for the entire project and set a project name using the --add_project_name option. ```bash python manage.py dbml --add_project_name "Backoffice" ``` -------------------------------- ### Generate DBML for a subset of apps Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate DBML for multiple specified Django apps. ```bash python manage.py dbml accounts billing crm ``` -------------------------------- ### Run Tests with Custom Cache Directory Source: https://github.com/makecodes/django-dbml/blob/main/docs/development.md Executes the test suite using a custom cache directory for UV. This ensures tests run correctly even with restricted cache access. ```bash UV_CACHE_DIR=.uv-cache make test ``` -------------------------------- ### Write DBML schema to a file Source: https://github.com/makecodes/django-dbml/blob/main/README.md Use the --output_file option to save the generated DBML schema to a specified file. ```bash python manage.py dbml --output_file schema.dbml ``` -------------------------------- ### Save DBML output to a file Source: https://github.com/makecodes/django-dbml/blob/main/README.md Save the generated DBML schema to a file using the --output_file option. ```bash python manage.py dbml --output_file docs/schema.dbml ``` -------------------------------- ### Add django_dbml to INSTALLED_APPS Source: https://github.com/makecodes/django-dbml/blob/main/README.md Add 'django_dbml' to your Django project's INSTALLED_APPS setting. ```python INSTALLED_APPS = [ # ... "django_dbml", ] ``` -------------------------------- ### Use physical table names in DBML Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate DBML using the underlying database table names instead of Django model labels with the --table_names option. ```bash python manage.py dbml --table_names ``` -------------------------------- ### Test Against Specific Django Branch Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Run tests against a specific Django version constraint and Python version. ```bash make test-django DJANGO_CONSTRAINT="django>=5.1,<5.2" PYTHON=3.13 ``` -------------------------------- ### Generate DBML for a single app Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate DBML for all models within a specific Django app. ```bash python manage.py dbml billing ``` -------------------------------- ### Generate DBML for a subset of models Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate DBML for specific models across different Django apps. ```bash python manage.py dbml billing.Invoice billing.InvoiceLine ``` -------------------------------- ### Run Tests Against Specific Django Series Source: https://github.com/makecodes/django-dbml/blob/main/docs/development.md Executes the test suite against a particular Django version series and Python version. Useful for compatibility testing. ```bash make test-django DJANGO_CONSTRAINT="django>=5.0,<5.1" PYTHON=3.12 ``` -------------------------------- ### Regenerate Lockfile Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md If dependencies change in pyproject.toml, regenerate the lockfile and sync. ```bash make lock make sync ``` -------------------------------- ### Django DBML Management Command Reference Source: https://github.com/makecodes/django-dbml/blob/main/README.md The base command for django-dbml is 'python manage.py dbml'. It accepts app labels and model names as arguments, along with various options. ```bash python manage.py dbml [app_label[.ModelName] ...] [options] ``` -------------------------------- ### Generate DBML for a single model Source: https://github.com/makecodes/django-dbml/blob/main/README.md Generate DBML for a specific model within a Django app. ```bash python manage.py dbml billing.Invoice ``` -------------------------------- ### Run Lint Checks Source: https://github.com/makecodes/django-dbml/blob/main/CONTRIBUTING.md Perform linting checks on the codebase to maintain code style consistency. ```bash make lint ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.