holistics/dbml

v2 parser inconsistency with double-quoted list defaults

Closed this issue ยท 2 comments

๐Ÿ‘‹ Noticed this small inconsistency with the v2 parser vs. v1:

import { Parser, ModelExporter } from "@dbml/core";

const schema = `
Table foo {
  bar "varchar[]" [default: "{baz}"]
}
`;

const v1 = new Parser().parse(schema, 'dbml');
console.log(ModelExporter.export(v1.normalize(), 'postgres'));

const v2 = new Parser().parse(schema, 'dbmlv2');
console.log(ModelExporter.export(v2.normalize(), 'postgres'));

v1 logs as expected, but v2 throws Can not find Enum field '{baz}'.

https://replit.com/@MattIPv4/DBML-v2-parser-inconsistency

This is fixable by switching to a single-quote '{baz}' string, and looking at the docs, I think it should be using single-quotes as a plain-text string, but wanted to flag the parsing inconsistency all the same.

Thank you for reporting the issue. We'll consider re-adding the double quotes shortly.

Fixed is #488