Skip to content

Parsing multiple statements #14

@dazinator

Description

@dazinator

Hey - long time no speak :)

I was wondering if you have any thoughts around how to parse a SQL string that has multiple inidividual statements? For example - I would like to be able to parse:

UPDATE customer SET firstname = 'Dave' WHERE id = 1;
UPDATE customer SET firstname = 'Jo' WHERE id = 2;
DELETE FROM customer WERE id = 3

At the moment, the parser is expecting a single UPDATE, INSERT, SELECT statement etc and so if you try to parse this string, it falls over.

I am suspecting that me doing a string split on a semi colon prior to parsing may not be ideal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions