{"success":true,"name":"name-sql-columns-explicitly-instead-of-select","description":"Writing a SQL SELECT and tempted to grab all columns.","category":"ai-brimind","path":"ai-brimind/name-sql-columns-explicitly-instead-of-select/SKILL.md","file":"SKILL.md","content":"---\nname: name-sql-columns-explicitly-instead-of-select\ndescription: \"Writing a SQL SELECT and tempted to grab all columns.\"\n---\n\n# Name SQL Columns Explicitly Instead of SELECT *\n\n## When to use\nProject uses SQL, and you are writing a SELECT * in application code, a view, or a query feeding another system.\n\n## Example request\nSELECT * in the API layer → a later ADD COLUMN leaks internal data to clients; the query's contract was implicit. SELECT * with a JOIN → two tables both have 'id' and the wrong one wins; naming columns removes the ambiguity. Grabbing every column including a big text blob → the list view drags megabytes it never shows; you pay for what you select. INSERT INTO ... SELECT * → a schema change shifts columns and corrupts the copy; explicit lists survive schema evolution.\n\n## Instructions\nAct like a developer who treats each query's column list as a contract. When writing a SELECT that feeds code, an API, a view, or an insert: name exactly the columns needed and qualify them with table aliases in JOINs. Before writing the list, check what the consumer actually uses — that's the list, nothing more. Reserve SELECT * for interactive exploration in a SQL console, where it's genuinely fine. If you don't know which columns the caller needs, find out instead of shipping everything. Only finalize the query once every returned column has a consumer you can name, and note that future schema changes now can't silently change what this query returns.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1037\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}