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
Redshift CREATE SCHEMA statements #2252
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8a194a0
Create schema for Redshift
rpr-ableton e8945c3
Merge branch 'main' into redshift-create-schema
rpr-ableton 1ad4c3e
fixes based on jpy-git's comments
rpr-ableton 21623e2
Merge branch 'main' into redshift-create-schema
rpr-ableton 7372508
Merge branch 'redshift-create-schema' of github.com:rpr-ableton/sqlfl…
rpr-ableton File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
test/fixtures/dialects/redshift/redshift_create_schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE SCHEMA s1; | ||
CREATE SCHEMA IF NOT EXISTS s1; | ||
|
||
CREATE SCHEMA s1 AUTHORIZATION dwuser; | ||
CREATE SCHEMA IF NOT EXISTS s1 AUTHORIZATION dwuser; | ||
|
||
CREATE SCHEMA s1 AUTHORIZATION dwuser QUOTA 100 MB; | ||
CREATE SCHEMA IF NOT EXISTS s1 AUTHORIZATION dwuser QUOTA 100 MB; | ||
|
||
CREATE SCHEMA s1 AUTHORIZATION dwuser QUOTA 5 GB; | ||
CREATE SCHEMA IF NOT EXISTS s1 AUTHORIZATION dwuser QUOTA 5 GB; | ||
|
||
CREATE SCHEMA s1 AUTHORIZATION dwuser QUOTA 0.1 TB; | ||
CREATE SCHEMA IF NOT EXISTS s1 AUTHORIZATION dwuser QUOTA 0.1 TB; | ||
|
||
CREATE SCHEMA s1 AUTHORIZATION dwuser QUOTA UNLIMITED; | ||
CREATE SCHEMA IF NOT EXISTS s1 AUTHORIZATION dwuser QUOTA UNLIMITED; | ||
|
||
CREATE SCHEMA AUTHORIZATION dwuser; | ||
|
||
CREATE SCHEMA AUTHORIZATION dwuser QUOTA 100 MB; | ||
|
||
CREATE SCHEMA AUTHORIZATION dwuser QUOTA 5 GB; | ||
|
||
CREATE SCHEMA AUTHORIZATION dwuser QUOTA 0.1 TB; | ||
|
||
CREATE SCHEMA AUTHORIZATION dwuser QUOTA UNLIMITED; |
212 changes: 212 additions & 0 deletions
212
test/fixtures/dialects/redshift/redshift_create_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
# YML test files are auto-generated from SQL files and should not be edited by | ||
# hand. To help enforce this, the "hash" field in the file must match a hash | ||
# 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: 9c60d7f03836f977999a5ad56c70f44448fef6e0cadd94dfe772a82624f91e41 | ||
file: | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '100' | ||
- keyword: MB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '100' | ||
- keyword: MB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '5' | ||
- keyword: GB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '5' | ||
- keyword: GB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '0.1' | ||
- keyword: TB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '0.1' | ||
- keyword: TB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- keyword: UNLIMITED | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: IF | ||
- keyword: NOT | ||
- keyword: EXISTS | ||
- schema_reference: | ||
identifier: s1 | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- keyword: UNLIMITED | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '100' | ||
- keyword: MB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '5' | ||
- keyword: GB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- literal: '0.1' | ||
- keyword: TB | ||
- statement_terminator: ; | ||
- statement: | ||
create_schema_statement: | ||
- keyword: CREATE | ||
- keyword: SCHEMA | ||
- keyword: AUTHORIZATION | ||
- object_reference: | ||
identifier: dwuser | ||
- keyword: QUOTA | ||
- keyword: UNLIMITED | ||
- statement_terminator: ; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the docs there's a bit missing from the end of the grammar here:
[ schema_element [ ... ]
The docs aren't very clear for me as to what exactly they represent but if you're familiar with them then would be good to add them in.
If not then just add a TODO note to the end of the docstring mentioning that we haven't added this.