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

Feature Request: Add datatypes for Snowflake Keywords #641

Closed
PKRacha opened this issue Sep 5, 2023 · 0 comments
Closed

Feature Request: Add datatypes for Snowflake Keywords #641

PKRacha opened this issue Sep 5, 2023 · 0 comments
Labels

Comments

@PKRacha
Copy link

PKRacha commented Sep 5, 2023

Describe the Feature
I would like to add the datatypes keywords for Snowflake so that they become upper or lower case when the formatting option is choosen.

Why do you want this feature?
This is a common practice to have the upper case data types across the industry.

I have created the code locally, but don't have the permissions to push it to Github. Hence, adding the code here:
In snowflake.keywords.ts at line 100

  datatypes: [
    'NUMBER',
    'DECIMAL',
    'NUMERIC',
    'INT',
    'INTEGER',
    'BIGINT',
    'SMALLINT',
    'TINYINT',
    'BYTEINT',
    'FLOAT',
    'FLOAT4',
    'FLOAT8',
    'DOUBLE',
    'DOUBLE PRECISION',
    'REAL',
    'VARCHAR',
    'CHAR',
    'CHARACTER',
    'STRING',
    'TEXT',
    'BINARY',
    'VARBINARY',
    'BOOLEAN',
    'DATE',
    'DATETIME',
    'TIME',
    'TIMESTAMP',
    'TIMESTAMP_LTZ',
    'TIMESTAMP_NTZ',
    'TIMESTAMP',
    'TIMESTAMP_TZ',
    'VARIANT',
    'OBJECT',
    'ARRAY',
    'GEOGRAPHY',
    'GEOMETRY',
  ],

In snowflake.test.ts line 109

  it('formats CREATE TABLE', () => {
    expect(
      format(
        `CREATE    TABLE t (foo stRing COMMENT 'blah', abc numBer (38, 0) COMMENT 'testing number with                  length more');`, {
          keywordCase: 'upper',
        }
      )
    ).toBe(dedent`
    CREATE TABLE
      t (
        foo STRING COMMENT 'blah',
        abc NUMBER (38, 0) COMMENT 'testing number with                  length more'
      );`);
  });

Once done, please refresh the VS Code extension as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant