Skip to content

Inline references should be case-insensitive #40

Open
@brunobcosta

Description

@brunobcosta

Context

Some editors like https://dbdiagram.io/ and vs-code plugins suggest the "Ref" keyword like this, in pascal-case.
I couldn't find any mention in the dbml spec about keyword casing, so my guess is that this should be case-insensitive, just like others like "pk" and "table" already are.

Problem

Inline references are not rendering when has capital letters in keyword.
In the following example, five references are expected in the output, but just three has actually created. The capital two arent recognized.


Table countries {
  code int [pk]
  name varchar
}

Table users as U {
  id int [pk, increment]
  full_name varchar

  country_code int [ref: > countries.code] //has output
}

Table merchants {
  id int [pk]
  name varchar
  country_code int [Ref: > countries.code] //does not output
  admin_id int [REF: > U.id] //does not output
}

Table products {
  id int [pk]
  name varchar
  merchant_id int 
  country_code int
}

ref: products.merchant_id > merchants.id //has output
Ref: products.country_code > countries.code //has output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions