Skip to content

Conversation

@urkle
Copy link
Contributor

@urkle urkle commented Dec 5, 2024

Contains several changes to improve spec compliance.

  • Allow Note blocks at the root schema sticky notes
  • Add notes on table groups spec
  • Add table group settings spec
  • improve tests so they compare against the ron files in the out folder (set the ENV UPDATE_DBML_OUTPUT=1 to have the test suite update the ron files)
    • enable test running for the mysql/mssql/postgres importer files
  • Add in double-quoted string in attributes
    • needed for the DB importer files as the index names get exported in double-quotes
  • improved column type handling to support
    • schemas in the col_type (e.g. schemaB.my_enum when using a enum from another schema)
    • [] placement on unquoted type names (e.g. char[] or my_enum[])
    • [] placement after the quoted type name (e.g. "character varying"[])
    • mixed quoting with schema (e.g. "schemaB"."my_enum" or schemaB."my_enum" etc.)

urkle added 4 commits December 4, 2024 17:15
- this is used by the sql2dbml exporter with the name setting on indexes
Support the following previously unhandled forms

- schema.enum_type
- schema."enum_type"
- "schema"."enum_type"
- schema.enum_type[]
- schema."enum_type"[]
- "schema"."enum_type"[]
- char[]

Also handle ambiguity between array and settings (both using []) by making the col_type atomic (to not allow whitespace and comments between tokens). Which matches upstream behavior.

(all of which are supported by the upstream JS DBML parser)
@apskhem
Copy link
Owner

apskhem commented Jan 3, 2025

Hi @urkle, thank you so much for this huge contribution! The PR has included the part that I'm going to address about that parsing weirdness of raw string, and also some additional improvements according to the spec. I think everything that you've done is pretty much okay. And I'm thinking that after merging your PR into the main branch, I'll change the version into stable 1.0.0 as you've include the test part and spec stabilization.

Thank you again. Big kudos to you 👏.

@apskhem apskhem merged commit 7d3b0db into apskhem:main Jan 3, 2025
1 check passed
@apskhem apskhem requested review from apskhem and removed request for apskhem January 3, 2025 17:12
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.

2 participants