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

Added bare functions to values clause #1876

Merged
merged 1 commit into from Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sqlfluff/dialects/dialect_ansi.py
Expand Up @@ -1827,6 +1827,7 @@ class ValuesClauseSegment(BaseSegment):
Ref("LiteralGrammar"),
Ref("IntervalExpressionSegment"),
Ref("FunctionSegment"),
Ref("BareFunctionSegment"),
"DEFAULT", # not in `FROM` clause, rule?
ephemeral_name="ValuesClauseElements",
)
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/dialects/postgres/postgres_insert.sql
@@ -1 +1,2 @@
INSERT INTO test (id, col1) OVERRIDING SYSTEM VALUE VALUES (1, 'val');
INSERT INTO foo (bar) VALUES(current_timestamp);
24 changes: 21 additions & 3 deletions test/fixtures/dialects/postgres/postgres_insert.yml
Expand Up @@ -3,9 +3,9 @@
# computed by SQLFluff when running the tests. Please run
# `python test/generate_parse_fixture_yml.py` to generate them after adding or
# altering SQL files.
_hash: 0a486da74287f772aad5a317403b1c8a0c67d03e811aa65d29a763a305fe5362
_hash: 563d01a9d3f4d84492323c33e29057117a47da895863eb69e48beccd4bc53a5e
file:
statement:
- statement:
insert_statement:
- keyword: INSERT
- keyword: INTO
Expand All @@ -30,4 +30,22 @@ file:
- comma: ','
- literal: "'val'"
- end_bracket: )
statement_terminator: ;
- statement_terminator: ;
- statement:
insert_statement:
- keyword: INSERT
- keyword: INTO
- table_reference:
identifier: foo
- bracketed:
start_bracket: (
column_reference:
identifier: bar
end_bracket: )
- values_clause:
keyword: VALUES
bracketed:
start_bracket: (
bare_function: current_timestamp
end_bracket: )
- statement_terminator: ;