Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional clauses/keywords to the insert statement #118

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

wishdev
Copy link
Contributor

@wishdev wishdev commented Mar 6, 2023

No description provided.

Copy link
Collaborator

@matthias-Q matthias-Q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split up the compound keywords like ON CONFLICT

grammar.js Outdated Show resolved Hide resolved
grammar.js Outdated Show resolved Hide resolved
@@ -948,18 +954,44 @@ module.exports = grammar({
),

insert: $ => seq(
choice($.keyword_insert, $.keyword_replace),
$.keyword_into,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is keyword_into now optional? For which dialect is this change?.

Copy link
Contributor Author

@wishdev wishdev Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySQL does not require it - I thought it was always optional but apparently not. [1] is the MySQL reference

SQL Server does not require it either it appears [2]

[1] - https://dev.mysql.com/doc/refman/8.0/en/insert.html
[2] - https://learn.microsoft.com/en-us/sql/t-sql/statements/insert-transact-sql?view=sql-server-ver16

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. Before your PR the grammar required an INTO keyword, but it looks like it is optional in MySQL and MariaDB as well.

grammar.js Outdated Show resolved Hide resolved
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.

3 participants