Skip to content

Conversation

MasterOdin
Copy link
Member

PR fixes identifying BEGIN TRANSACTION statements. A number of SQL dialects (e.g. bigquery, sqlite) use BEGIN both as a block opener, and as keyword right before TRANSACTION to start a transaction (or in the case of sqlite, there's also three types of transactions one can use, see docs). As such, we now pass in the nextToken when parsing in addition to the current token, allowing us to peek ahead one and see if BEGIN acts as a block opener, or to begin a transaction.

I debated on making BEGIN check only for those dialects that use this explicitly, but decided against it and to make it generic in that there's probably no client that has BEGIN TRANSACTION and expects that to be operating in block mode as a fully working query.

@MasterOdin MasterOdin merged commit c0aef43 into main Aug 26, 2022
@MasterOdin MasterOdin deleted the bugfix-transaction branch August 26, 2022 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant