Skip to content

ON_CONFLICT UPDATE SET confuses parser #197

Description

@hypergonial

When using PostgreSQL:

>>> sql = 'INSERT INTO global_config (entry_id) VALUES ($1) ON CONFLICT (entry_id) UPDATE SET entry_id = $1'
>>> parser = Parser(sql)
>>> parser.tables
['global_config', 'SET']

It seems to think that SET is also a tablename, but in Postgres you can omit the tablename/WHERE in an ON CONFLICT clause as it only executes the code if it conflicts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions