Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed Oct 13, 2021
2 parents 01e6cfe + 14e1a23 commit 6b2f536
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sqlfluff/dialects/dialect_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,12 +1158,12 @@ class ColumnConstraintSegment(BaseSegment):
Sequence(
OneOf("AUTOINCREMENT", "IDENTITY"),
OneOf(
Bracketed(Delimited(Ref("NumericLiteralValue"))),
Bracketed(Delimited(Ref("NumericLiteralSegment"))),
Sequence(
"START",
Ref("NumericLiteralValue"),
Ref("NumericLiteralSegment"),
"INCREMENT",
Ref("NumericLiteralValue"),
Ref("NumericLiteralSegment"),
),
),
),
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/dialects/snowflake/snowflake_create_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ CREATE TABLE timestamp_column_default_value_demo (
timestamp_col3 TIMESTAMP_TZ DEFAULT CURRENT_TIMESTAMP(2),
sysdate_col4 TIMESTAMP_TZ DEFAULT SYSDATE()
);

create table test_table (test_column NUMBER autoincrement (0, 1));
create table test_schema.test_table (test_column NUMBER autoincrement (0, 1));
create or replace table test_schema.test_table (test_column NUMBER autoincrement (0, 1));
74 changes: 73 additions & 1 deletion test/fixtures/dialects/snowflake/snowflake_create_table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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: 42d41ad60a4693f4fce33fdc6d8a2da40c5ac054ee5cca2951debc2672c56a12
_hash: 63464647b2201f8b0742e86153275af74f2954ad95b1dab8d7043977e27c2bc3
file:
- statement:
create_table_statement:
Expand Down Expand Up @@ -625,3 +625,75 @@ file:
end_bracket: )
- end_bracket: )
- statement_terminator: ;
- statement:
create_table_statement:
- keyword: create
- keyword: table
- table_reference:
identifier: test_table
- bracketed:
start_bracket: (
column_definition:
identifier: test_column
data_type:
data_type_identifier: NUMBER
column_constraint_segment:
keyword: autoincrement
bracketed:
- start_bracket: (
- literal: '0'
- comma: ','
- literal: '1'
- end_bracket: )
end_bracket: )
- statement_terminator: ;
- statement:
create_table_statement:
- keyword: create
- keyword: table
- table_reference:
- identifier: test_schema
- dot: .
- identifier: test_table
- bracketed:
start_bracket: (
column_definition:
identifier: test_column
data_type:
data_type_identifier: NUMBER
column_constraint_segment:
keyword: autoincrement
bracketed:
- start_bracket: (
- literal: '0'
- comma: ','
- literal: '1'
- end_bracket: )
end_bracket: )
- statement_terminator: ;
- statement:
create_table_statement:
- keyword: create
- binary_operator: or
- keyword: replace
- keyword: table
- table_reference:
- identifier: test_schema
- dot: .
- identifier: test_table
- bracketed:
start_bracket: (
column_definition:
identifier: test_column
data_type:
data_type_identifier: NUMBER
column_constraint_segment:
keyword: autoincrement
bracketed:
- start_bracket: (
- literal: '0'
- comma: ','
- literal: '1'
- end_bracket: )
end_bracket: )
- statement_terminator: ;

0 comments on commit 6b2f536

Please sign in to comment.