Skip to content

Fails to parse output from pg_dump? #99

@bjmc

Description

@bjmc

I'm not sure if I'm using this wrong, but DDLParser() fails to parse the attached PostgreSQL schema output from pg_dump

schema.txt

Traceback:

~/.cache/pypoetry/virtualenvs/capgras-r404Yw5Z-py3.8/lib/python3.8/site-packages/simple_ddl_parser/parser.py in run(self, dump, dump_path, file_path, output_mode, group_by_type, json_dump)
    228             Dict == one entity from ddl - one table or sequence or type.
    229         """
--> 230         tables = self.parse_data()
    231         tables = result_format(tables, output_mode, group_by_type)
    232         if dump:

~/.cache/pypoetry/virtualenvs/capgras-r404Yw5Z-py3.8/lib/python3.8/site-packages/simple_ddl_parser/parser.py in parse_data(self)
    167                 if final_line or new_statement:
    168                     # end of sql operation, remove ; from end of line
--> 169                     statement = statement[:-1]
    170                 elif num != len(lines) - 1 and not skip:
    171                     # continue combine lines in one massive

TypeError: 'NoneType' object is not subscriptable

Please feel free to close this issue if you don't intend to support this use-case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions