Skip to content

fix(dbml/core): avoid dangling 'default: ' in DbmlExporter when field.dbdefault.type is invalid#654

Merged
huydo862003 merged 1 commit intoholistics:masterfrom
Mrxyy:origin-master
Nov 6, 2025
Merged

fix(dbml/core): avoid dangling 'default: ' in DbmlExporter when field.dbdefault.type is invalid#654
huydo862003 merged 1 commit intoholistics:masterfrom
Mrxyy:origin-master

Conversation

@Mrxyy
Copy link
Copy Markdown
Contributor

@Mrxyy Mrxyy commented Nov 1, 2024

When using dbmlExporter, if field.dbdefault.type is not set, a value of "DEFAULT " will appear. However, other Exporters will directly use field.dbdefault.type. I think it needs to be consistent.
.e.g:
MysqlExporter
image
OracleExporter
image
PostgresExporter
image

Summary

  • Short summary of the task, what have been done etc
  • Please include screenshots whenever possible (important).

Issue

(issue link here)

Lasting Changes (Technical)

(please list down: code changes/things that have wide-effect; new libraries/functions added that can be used by others; examples below)

  • (Added class EmailValidator to validate email address' validity)
  • (Added Tenant#is_trial? check)

Checklist

Please check directly on the box once each of these are done

  • Documentation (if necessary)
  • Tests (integration test/unit test)
  • Integration Tests Passed
  • Code Review

…nsistently

When using dbmlExporter, if field.dbdefault.type is not set, a value of "DEFAULT  <null value>" will appear. However, other Exporters will directly use field.dbdefault.type. I think it needs to be consistent.
@Mrxyy Mrxyy changed the title fix: Fixed DbmlExporter and other type Exporters to export DEFAULT co… fix: Fixed DbmlExporter and other type Exporters to export DEFAULT consistently Nov 1, 2024
@NQPhuc
Copy link
Copy Markdown
Contributor

NQPhuc commented Nov 4, 2024

Hi @Mrxyy,

Thank you for contributing to dbml!

To help with getting this PR merged, kindly assist in:

  • Make sure the unit tests passed
  • Add a test for dbdefault that cover your deafult type case. For this PR, I think you should add the test in packages/dbml-core/__test__/model_exporter/dbml_exporter/input/default_tables.in.json.

@huydo862003 huydo862003 changed the title fix: Fixed DbmlExporter and other type Exporters to export DEFAULT consistently fix(dbml/core): avoid dangling 'default: ' in DbmlExporter when field.dbdefault.type is invalid Nov 6, 2025
@huydo862003 huydo862003 added the PR: Bug Fix 🐛 A type of pull request used for changelog categories label Nov 6, 2025
@huydo862003 huydo862003 merged commit 0bb2c76 into holistics:master Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 A type of pull request used for changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants