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

select * from prevention and auto-resolution based on upstream raw schema and/or model definition #3139

Open
sungchun12 opened this issue Sep 16, 2024 · 0 comments
Labels
Feature Adds new functionality

Comments

@sungchun12
Copy link
Contributor

sungchun12 commented Sep 16, 2024

Everyone understands that it's best practice to avoid select * from by default, but it's the easiest way for users to keep moving fast. In plain terms, people will bias towards this whether we like it or not. This will also mess with impact analysis as non-breaking changes won't be taken advantage of in sql models. The goal of this is to make the developer experience enjoyable for the boring and tedious bits.

It'd be nice to have a config in config.yaml that inserts a behavior before running sqlmesh plan <dev env> that prompts the user to write out the columns by hand OR if possible, ask for permission to overwrite * with all the columns and then simply overwrites it using the @STAR macro behind the scenes: https://sqlmesh.readthedocs.io/en/stable/concepts/macros/sqlmesh_macros/?h=@star#star

gateways:
    tobiko_cloud: # this will use the config in tcloud.yaml for state_connection
        connection:
            type: bigquery
            method: service-account-json
            concurrent_tasks: 5
            register_comments: true
            keyfile_json: {{ env_var('GOOGLE_SQLMESH_CREDENTIALS') }}
            project: sqlmesh-public-demo

default_gateway: tobiko_cloud

prevent_select_star: true # a config like this
@sungchun12 sungchun12 added the Feature Adds new functionality label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Adds new functionality
Projects
None yet
Development

No branches or pull requests

1 participant