Vanderhoof/PyDBML

Single quotes within comments are not handled properly

Closed this issue · 3 comments

' will not be handled properly in the following:

Table something.thing {
  id int [note: "this statement CAN'T be compiled correctly"]
}

@fivegrant could you check if you have the most recent version? It should have been fixed in 1.0.2 (latest is 1.0.3)

>>> from pydbml import PyDBML
>>> d = PyDBML("""
... Table something.thing {
...   id int [note: "this statement CAN'T be compiled correctly"]
... }
... """)
>>> d.tables[0]
<Table 'something' 'thing'>
>>> d.tables[0][0]
<Column 'id', 'int'>
>>> d.tables[0][0].note
Note("this statement CAN'T be compiled correctly")

Ah, ok, there's still a problem with exporting quotes. Will be fixed in the next version!

>>> print(d.dbml)
Table "something"."thing" {
    "id" int [note: 'this statement CAN'T be compiled correctly']
}

Fixed in 1.0.4