Hi,
the table notes example from the DBML docs can be parsed as-is by PyDBML. However, when the Note property is moved to any other position than the very last one (e.g. to the top):
Table users {
Note: 'Stores user data'
id integer
status varchar [note: 'status']
}
PyDBML raises an error:
>>> parsed = PyDBML(Path('test.dbml'), allow_properties=True)
pyparsing.exceptions.ParseException: Expected {{{W:(0-9A-Z_a-zª²³...) | string enclosed in '"'} '[]'} | {W:(0-9A-Z_a-zª²³...) | string enclosed in '"'} '.' {W:(0-9A-Z_a-zª²³...) | string enclosed in '"'} | {{W:(0-9A-Z_a-zª²³...) | string enclosed in '"'} ['(' {Empty Forward: [{{{{[W:(0-9A-Z_a-z)] '(' : ...} ')'} | {W:("'+-.0-9A-Z_-z) {{',' | ');'} | {end of line ');'}}}} | W:(
"'+-.0-9A-...)}]... Empty} ')']}}, found ':' (at char 20), (line:2, col:7)
The modified table definition can be rendered just fine with https://dbdiagram.io, though. Personally, I'd love to see the same behavior with both parsers. What do you think - should these restrictions be loosened in the parser, or is there a certain reason for them?
Best regards,
Aardjon
Hi,
the table notes example from the DBML docs can be parsed as-is by PyDBML. However, when the
Noteproperty is moved to any other position than the very last one (e.g. to the top):PyDBML raises an error:
The modified table definition can be rendered just fine with https://dbdiagram.io, though. Personally, I'd love to see the same behavior with both parsers. What do you think - should these restrictions be loosened in the parser, or is there a certain reason for them?
Best regards,
Aardjon