Vanderhoof/PyDBML

Adding project tag not working

Closed this issue · 2 comments

idan3 commented

Everything works good until I add a "project" tag.
I add "project my_proj {" at the first line of the dbml file and "}" at the last line of the file.
I get an exception:
raise exc.with_traceback(None) pyparsing.exceptions.ParseSyntaxException: Expected '}', found 'Table' (at char 23), (line:3, col:1)

Wow, that's new to me, I didn't know you can wrap your whole schema in a Project braces. At least there's nothing in the docs about this behavior. But on dbdiagram.io and in dbml cli it works.

Anyway, you can declare your project as a separate object for now, and later I may add the wrapping behavior:

Project my_proj {
      author: 'john smith'
      note: 'project note'
}

Table clients {
...

Decided that since this is not an official behavior, better to stick to the docs.