-
Notifications
You must be signed in to change notification settings - Fork 940
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
Quoting for database catalogs, schemas, tables, and columns #3518
Labels
content
Improvements or additions to content
improvement
Use this when an area of the docs needs improvement as it's currently unclear
Comments
dbeatty10
added
content
Improvements or additions to content
improvement
Use this when an area of the docs needs improvement as it's currently unclear
labels
Jun 13, 2023
This was referenced Oct 26, 2023
Closed
This was referenced Feb 6, 2024
2 tasks
This was referenced Mar 12, 2024
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
content
Improvements or additions to content
improvement
Use this when an area of the docs needs improvement as it's currently unclear
Contributions
Link to the page on docs.getdbt.com requiring updates
There are a couple things that are mostly frequently quoted within SQL:
For example, all of the following can be quoted within SQL:
database
/ catalog names (project
in BigQuery)schema
names (dataset
in BigQuery)identifier
names (table / view / etc. names)column
namescolumn
valuesuser
s,role
s,index
es, etc.)We have all of the following documentation, but it rarely refers to each other:
For
database
,schema
, andidentifier
namesquoting
- Configuring quoting in projects (fordatabase
,schema
, andidentifier
)quoting
- Configuring quoting in sources (fordatabase
,schema
, andidentifier
)quoted
method in the Relation class - Applying quoting to relations (fordatabase
,schema
, andidentifier
) (source)as_case_sensitive
in the SnowflakeRelation class (see also: dbt-snowflake #1111)For
column
namesquote
- Configuring quoting in models forcolumn
namesquote_columns
- Configuring quoting in seed files forcolumn
namesquote_seed_column
- Quote or do not quote the column name of a seed according to thequote_columns
configurationquoted
method in the Column class via Column API - Applying quoting to relation columns forcolumn
namesquote_identifiers
in macros withindbt_utils
(likestar
andpivot
)For
column
valuesquote
withinaccepted_values
- Configuring quoting in data tests for acceptedcolumn
valuesdbt.string_literal
- Applying quoting tocolumn
values in Jinjadbt.escape_single_quotes
- Escaping single quotes withincolumn
values in JinjaFor multiple purposes
adapter.quote
- Applying quoting via the adapter-specific macro to acolumn
name or individual components of a (database
,schema
,identifier
) combo (or even other database objects likeusers
orroles
) (source).quote_as_configured
- Quote or do not quote the given database, schema, or identifier according to thequoting
project configuration.For users / groups / roles in grants
As hinted at in dbt-labs/dbt-postgres#55, we don't have any mechanism to specify that a grant should be quoted. i.e., we don't have a
quote_grants
config.What part(s) of the page would you like to see updated?
It would be an improvement to merely cross-link these different pages so that the first result in a Google search is likely to eventually lead where you want to get.
Additional information
Instigating scenario: dbt-labs/dbt-core#7832
dbt-labs/dbt-core#2986 aims to unify all of these under a single
quote
config/property, but the earliest that might happen is v1.9+, and we'd want to clarify things for users earlier than that as well.The text was updated successfully, but these errors were encountered: