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

Snowflake: support for extended column options in CREATE TABLE #1454

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

7phs
Copy link
Contributor

@7phs 7phs commented Oct 2, 2024

Snowflake supports several extended options for column definitions:

-- Column definition
    <col_name> <col_type>
      [ inlineConstraint ]
      [ NOT NULL ]
      [ COLLATE '<collation_specification>' ]
      [
        {
          DEFAULT <expr>
          | { AUTOINCREMENT | IDENTITY }
            [
              {
                ( <start_num> , <step_num> )
                | START <num> INCREMENT <num>
              }
            ]
            [ { ORDER | NOORDER } ]
        }
      ]
      [ [ WITH ] MASKING POLICY <policy_name> [ USING ( <col_name> , <cond_col1> , ... ) ] ]
      [ [ WITH ] PROJECTION POLICY <policy_name> ]
      [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
      [ COMMENT '<string_literal>' ]

This merge request implements support for these additional column options.

@7phs 7phs force-pushed the snowflake_create_table_column_extended branch from 3b95e3b to ee816e2 Compare October 2, 2024 14:59
src/ast/ddl.rs Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_snowflake.rs Outdated Show resolved Hide resolved
tests/sqlparser_snowflake.rs Show resolved Hide resolved
@7phs 7phs force-pushed the snowflake_create_table_column_extended branch from e5ac170 to 0c3849e Compare October 9, 2024 10:25
@7phs 7phs requested a review from iffyio October 9, 2024 11:32
@7phs 7phs force-pushed the snowflake_create_table_column_extended branch from c731c4b to 96ec5b1 Compare October 9, 2024 11:35
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Outdated Show resolved Hide resolved
src/ast/ddl.rs Show resolved Hide resolved
src/ast/ddl.rs Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
@7phs 7phs requested a review from iffyio October 14, 2024 08:57
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.

2 participants