|
1 | 1 | # Warehouse Tools |
2 | 2 |
|
| 3 | +## project_scan |
| 4 | + |
| 5 | +Scan the entire data engineering environment in one call. Detects dbt projects, warehouse connections, Docker databases, installed tools, and configuration files. Used by the `/discover` command. |
| 6 | + |
| 7 | +``` |
| 8 | +> /discover |
| 9 | +
|
| 10 | +# Environment Scan |
| 11 | +
|
| 12 | +## Python Engine |
| 13 | +✓ Engine healthy |
| 14 | +
|
| 15 | +## Git Repository |
| 16 | +✓ Git repo on branch `main` (origin: github.com/org/analytics) |
| 17 | +
|
| 18 | +## dbt Project |
| 19 | +✓ Project "analytics" (profile: snowflake_prod) |
| 20 | + Models: 47, Sources: 12, Tests: 89 |
| 21 | + ✓ packages.yml found |
| 22 | +
|
| 23 | +## Warehouse Connections |
| 24 | +
|
| 25 | +### Already Configured |
| 26 | +Name | Type | Database |
| 27 | +prod-snowflake | snowflake | ANALYTICS |
| 28 | +
|
| 29 | +### From dbt profiles.yml |
| 30 | +Name | Type | Source |
| 31 | +dbt_snowflake_dev | snowflake | dbt-profile |
| 32 | +
|
| 33 | +### From Docker |
| 34 | +Container | Type | Host:Port |
| 35 | +local-postgres | postgres | localhost:5432 |
| 36 | +
|
| 37 | +### From Environment Variables |
| 38 | +Name | Type | Signal |
| 39 | +env_bigquery | bigquery | GOOGLE_APPLICATION_CREDENTIALS |
| 40 | +
|
| 41 | +## Installed Data Tools |
| 42 | +✓ dbt v1.8.4 |
| 43 | +✓ sqlfluff v3.1.0 |
| 44 | +✗ airflow (not found) |
| 45 | +
|
| 46 | +## Config Files |
| 47 | +✓ .altimate-code/altimate-code.json |
| 48 | +✓ .sqlfluff |
| 49 | +✗ .pre-commit-config.yaml (not found) |
| 50 | +``` |
| 51 | + |
| 52 | +### What it detects |
| 53 | + |
| 54 | +| Category | Detection method | |
| 55 | +|----------|-----------------| |
| 56 | +| **Git** | `git` commands (branch, remote) | |
| 57 | +| **dbt project** | Walks up directories for `dbt_project.yml`, reads name/profile | |
| 58 | +| **dbt manifest** | Parses `target/manifest.json` for model/source/test counts | |
| 59 | +| **dbt profiles** | Bridge call to parse `~/.dbt/profiles.yml` | |
| 60 | +| **Docker DBs** | Bridge call to discover running PostgreSQL/MySQL/MSSQL containers | |
| 61 | +| **Existing connections** | Bridge call to list already-configured warehouses | |
| 62 | +| **Environment variables** | Scans `process.env` for warehouse signals (see table below) | |
| 63 | +| **Schema cache** | Bridge call for indexed warehouse status | |
| 64 | +| **Data tools** | Spawns `tool --version` for 9 common tools | |
| 65 | +| **Config files** | Checks for `.altimate-code/`, `.sqlfluff`, `.pre-commit-config.yaml` | |
| 66 | + |
| 67 | +### Environment variable detection |
| 68 | + |
| 69 | +| Warehouse | Signal (any one triggers detection) | |
| 70 | +|-----------|-------------------------------------| |
| 71 | +| Snowflake | `SNOWFLAKE_ACCOUNT` | |
| 72 | +| BigQuery | `GOOGLE_APPLICATION_CREDENTIALS`, `BIGQUERY_PROJECT`, `GCP_PROJECT` | |
| 73 | +| Databricks | `DATABRICKS_HOST`, `DATABRICKS_SERVER_HOSTNAME` | |
| 74 | +| PostgreSQL | `PGHOST`, `PGDATABASE`, `DATABASE_URL` | |
| 75 | +| MySQL | `MYSQL_HOST`, `MYSQL_DATABASE` | |
| 76 | +| Redshift | `REDSHIFT_HOST` | |
| 77 | + |
| 78 | +### Parameters |
| 79 | + |
| 80 | +| Parameter | Type | Description | |
| 81 | +|-----------|------|-------------| |
| 82 | +| `skip_docker` | boolean | Skip Docker container discovery (faster) | |
| 83 | +| `skip_tools` | boolean | Skip installed tool detection (faster) | |
| 84 | + |
| 85 | +--- |
| 86 | + |
3 | 87 | ## warehouse_list |
4 | 88 |
|
5 | 89 | List all configured warehouse connections. |
@@ -54,3 +138,43 @@ Testing connection to bigquery-prod (bigquery)... |
54 | 138 | | `Object does not exist` | Wrong database/schema | Verify database name in config | |
55 | 139 | | `Role not authorized` | Insufficient privileges | Use a role with USAGE on warehouse | |
56 | 140 | | `Timeout` | Network latency | Increase connection timeout | |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +## warehouse_add |
| 145 | + |
| 146 | +Add a new warehouse connection by providing a name and configuration. |
| 147 | + |
| 148 | +``` |
| 149 | +> warehouse_add my-postgres {"type": "postgres", "host": "localhost", "port": 5432, "database": "analytics", "user": "analyst", "password": "secret"} |
| 150 | +
|
| 151 | +✓ Added warehouse 'my-postgres' (postgres) |
| 152 | +``` |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## warehouse_remove |
| 157 | + |
| 158 | +Remove an existing warehouse connection. |
| 159 | + |
| 160 | +``` |
| 161 | +> warehouse_remove my-postgres |
| 162 | +
|
| 163 | +✓ Removed warehouse 'my-postgres' |
| 164 | +``` |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## warehouse_discover |
| 169 | + |
| 170 | +Discover database containers running in Docker. Detects PostgreSQL, MySQL/MariaDB, and SQL Server containers with their connection details. |
| 171 | + |
| 172 | +``` |
| 173 | +> warehouse_discover |
| 174 | +
|
| 175 | +Container | Type | Host:Port | User | Database | Status |
| 176 | +local-postgres | postgres | localhost:5432 | postgres | postgres | running |
| 177 | +mysql-dev | mysql | localhost:3306 | root | mydb | running |
| 178 | +
|
| 179 | +Use warehouse_add to save any of these as a connection. |
| 180 | +``` |
0 commit comments