{"id":21585211,"url":"https://github.com/patricktrainer/dbt-no-select-star","last_synced_at":"2026-03-19T20:55:50.602Z","repository":{"id":109985312,"uuid":"561837335","full_name":"patricktrainer/dbt-no-select-star","owner":"patricktrainer","description":"Prevent `SELECT * FROM your_table;`","archived":false,"fork":false,"pushed_at":"2022-11-04T17:18:37.000Z","size":75,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T15:55:58.585Z","etag":null,"topics":["dbt","dbt-packages","jinja2","macros","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patricktrainer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-04T15:49:02.000Z","updated_at":"2022-11-04T17:23:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"80a0442f-a7b7-48f9-9b36-5751a8289977","html_url":"https://github.com/patricktrainer/dbt-no-select-star","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/patricktrainer/dbt-no-select-star","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fdbt-no-select-star","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fdbt-no-select-star/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fdbt-no-select-star/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fdbt-no-select-star/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patricktrainer","download_url":"https://codeload.github.com/patricktrainer/dbt-no-select-star/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fdbt-no-select-star/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29422573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbt","dbt-packages","jinja2","macros","sql"],"created_at":"2024-11-24T15:09:31.806Z","updated_at":"2026-02-13T23:10:17.811Z","avatar_url":"https://github.com/patricktrainer.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbt-no-select-star\n![Ah! Ah! Ah!](etc/ah-ah-ah.gif)\n\nThis [dbt](https://github.com/dbt-labs/dbt) package contains a macro that will throw an error if you attempt to use `select *` in your model. This macro effectively forces you to be explicit about the columns you want to select.\n\n## Installation\nAdding this package to your project will enable the macro. To install, add the following to your `packages.yml` file:\n\n```yml\npackages:\n  - git: \"https://github.com/patricktrainer/dbt-no-select-star.git\"\n    revision: 0.1.0\n```\n\n## Usage\nTo use the macro, simply add the following at the end of your model:\n\n```sql\n{{ no_select_star() }}\n```\n\nFor example:\n\n```sql\nselect \n  my_column,\n  my_other_column,\n  {{ no_select_star() }}\nfrom {{ ref(my_table) }}\n```\n\nThis will throw an error if you attempt to use `select *` in your model.\n\nThe error message will look like this:\n\n```bash\n'DONT SELECT * FROM THIS TABLE!!!1'\n```\n\nTo avoid the error, be explicit about the columns you want to select:\n\n```sql\nselect \n  my_column,\n  my_other_column\nfrom {{ ref(my_table) }}\n```\n\n## How does this work?\nThis works by leveraging _computed columns_. Computed columns are a feature that allow you to create a column that is the result of a SQL expression. If you inspect [the macro](macros/no_select_star.sql), you'll notice that it creates a `string` typed column. This column is then cast as a `char()` type with a length of 1 byte. Obviously, the string \"DONT SELECT * FROM THIS TABLE!!!1\" is longer than 1 byte, so the cast will fail. This will cause the query to fail, and the error message will be displayed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricktrainer%2Fdbt-no-select-star","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatricktrainer%2Fdbt-no-select-star","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricktrainer%2Fdbt-no-select-star/lists"}