Skip to content

Commit 9c2134e

Browse files
arora-saurabh448Saurabh Arora
andauthored
fix: documentation about connections. Fixes issue #313 (#318)
Co-authored-by: Saurabh Arora <saurabh@altimate.ai>
1 parent c734e19 commit 9c2134e

File tree

6 files changed

+167
-221
lines changed

6 files changed

+167
-221
lines changed

docs/docs/configure/warehouses.md

Lines changed: 89 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# Warehouses
22

3-
Altimate Code connects to 8 warehouse types. Configure them in the `warehouses` section of your config file or in `.altimate-code/connections.json`.
3+
Altimate Code connects to 8 warehouse types. Configure them in `.altimate-code/connections.json` (project-local) or `~/.altimate-code/connections.json` (global).
44

55
## Configuration
66

77
Each warehouse has a key (the connection name) and a config object:
88

99
```json
1010
{
11-
"warehouses": {
12-
"my-connection-name": {
13-
"type": "<warehouse-type>",
14-
...
15-
}
11+
"my-connection-name": {
12+
"type": "<warehouse-type>",
13+
...
1614
}
1715
}
1816
```
@@ -24,16 +22,14 @@ Each warehouse has a key (the connection name) and a config object:
2422

2523
```json
2624
{
27-
"warehouses": {
28-
"prod-snowflake": {
29-
"type": "snowflake",
30-
"account": "xy12345.us-east-1",
31-
"user": "analytics_user",
32-
"password": "{env:SNOWFLAKE_PASSWORD}",
33-
"warehouse": "COMPUTE_WH",
34-
"database": "ANALYTICS",
35-
"role": "ANALYST_ROLE"
36-
}
25+
"prod-snowflake": {
26+
"type": "snowflake",
27+
"account": "xy12345.us-east-1",
28+
"user": "analytics_user",
29+
"password": "{env:SNOWFLAKE_PASSWORD}",
30+
"warehouse": "COMPUTE_WH",
31+
"database": "ANALYTICS",
32+
"role": "ANALYST_ROLE"
3733
}
3834
}
3935
```
@@ -54,17 +50,15 @@ Each warehouse has a key (the connection name) and a config object:
5450

5551
```json
5652
{
57-
"warehouses": {
58-
"prod-snowflake": {
59-
"type": "snowflake",
60-
"account": "xy12345.us-east-1",
61-
"user": "svc_altimate",
62-
"private_key_path": "~/.ssh/snowflake_rsa_key.p8",
63-
"private_key_passphrase": "{env:SNOWFLAKE_KEY_PASSPHRASE}",
64-
"warehouse": "COMPUTE_WH",
65-
"database": "ANALYTICS",
66-
"role": "TRANSFORM_ROLE"
67-
}
53+
"prod-snowflake": {
54+
"type": "snowflake",
55+
"account": "xy12345.us-east-1",
56+
"user": "svc_altimate",
57+
"private_key_path": "~/.ssh/snowflake_rsa_key.p8",
58+
"private_key_passphrase": "{env:SNOWFLAKE_KEY_PASSPHRASE}",
59+
"warehouse": "COMPUTE_WH",
60+
"database": "ANALYTICS",
61+
"role": "TRANSFORM_ROLE"
6862
}
6963
}
7064
```
@@ -73,13 +67,11 @@ Each warehouse has a key (the connection name) and a config object:
7367

7468
```json
7569
{
76-
"warehouses": {
77-
"bigquery-prod": {
78-
"type": "bigquery",
79-
"project": "my-gcp-project",
80-
"credentials_path": "/path/to/service-account.json",
81-
"location": "US"
82-
}
70+
"bigquery-prod": {
71+
"type": "bigquery",
72+
"project": "my-gcp-project",
73+
"credentials_path": "/path/to/service-account.json",
74+
"location": "US"
8375
}
8476
}
8577
```
@@ -96,11 +88,9 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
9688

9789
```json
9890
{
99-
"warehouses": {
100-
"bigquery-prod": {
101-
"type": "bigquery",
102-
"project": "my-gcp-project"
103-
}
91+
"bigquery-prod": {
92+
"type": "bigquery",
93+
"project": "my-gcp-project"
10494
}
10595
}
10696
```
@@ -109,15 +99,13 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
10999

110100
```json
111101
{
112-
"warehouses": {
113-
"databricks-prod": {
114-
"type": "databricks",
115-
"server_hostname": "adb-1234567890.1.azuredatabricks.net",
116-
"http_path": "/sql/1.0/warehouses/abcdef1234567890",
117-
"access_token": "{env:DATABRICKS_TOKEN}",
118-
"catalog": "main",
119-
"schema": "default"
120-
}
102+
"databricks-prod": {
103+
"type": "databricks",
104+
"server_hostname": "adb-1234567890.1.azuredatabricks.net",
105+
"http_path": "/sql/1.0/warehouses/abcdef1234567890",
106+
"access_token": "{env:DATABRICKS_TOKEN}",
107+
"catalog": "main",
108+
"schema": "default"
121109
}
122110
}
123111
```
@@ -134,15 +122,13 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
134122

135123
```json
136124
{
137-
"warehouses": {
138-
"my-postgres": {
139-
"type": "postgres",
140-
"host": "localhost",
141-
"port": 5432,
142-
"database": "analytics",
143-
"user": "analyst",
144-
"password": "{env:PG_PASSWORD}"
145-
}
125+
"my-postgres": {
126+
"type": "postgres",
127+
"host": "localhost",
128+
"port": 5432,
129+
"database": "analytics",
130+
"user": "analyst",
131+
"password": "{env:PG_PASSWORD}"
146132
}
147133
}
148134
```
@@ -160,11 +146,9 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
160146

161147
```json
162148
{
163-
"warehouses": {
164-
"my-postgres": {
165-
"type": "postgres",
166-
"connection_string": "postgresql://analyst:secret@localhost:5432/analytics"
167-
}
149+
"my-postgres": {
150+
"type": "postgres",
151+
"connection_string": "postgresql://analyst:secret@localhost:5432/analytics"
168152
}
169153
}
170154
```
@@ -173,15 +157,13 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
173157

174158
```json
175159
{
176-
"warehouses": {
177-
"redshift-prod": {
178-
"type": "redshift",
179-
"host": "my-cluster.abc123.us-east-1.redshift.amazonaws.com",
180-
"port": 5439,
181-
"database": "analytics",
182-
"user": "admin",
183-
"password": "{env:REDSHIFT_PASSWORD}"
184-
}
160+
"redshift-prod": {
161+
"type": "redshift",
162+
"host": "my-cluster.abc123.us-east-1.redshift.amazonaws.com",
163+
"port": 5439,
164+
"database": "analytics",
165+
"user": "admin",
166+
"password": "{env:REDSHIFT_PASSWORD}"
185167
}
186168
}
187169
```
@@ -202,16 +184,14 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
202184

203185
```json
204186
{
205-
"warehouses": {
206-
"redshift-prod": {
207-
"type": "redshift",
208-
"host": "my-cluster.abc123.us-east-1.redshift.amazonaws.com",
209-
"database": "analytics",
210-
"user": "admin",
211-
"iam_role": "arn:aws:iam::123456789012:role/RedshiftReadOnly",
212-
"cluster_identifier": "my-cluster",
213-
"region": "us-east-1"
214-
}
187+
"redshift-prod": {
188+
"type": "redshift",
189+
"host": "my-cluster.abc123.us-east-1.redshift.amazonaws.com",
190+
"database": "analytics",
191+
"user": "admin",
192+
"iam_role": "arn:aws:iam::123456789012:role/RedshiftReadOnly",
193+
"cluster_identifier": "my-cluster",
194+
"region": "us-east-1"
215195
}
216196
}
217197
```
@@ -220,11 +200,9 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
220200

221201
```json
222202
{
223-
"warehouses": {
224-
"dev-duckdb": {
225-
"type": "duckdb",
226-
"path": "./dev.duckdb"
227-
}
203+
"dev-duckdb": {
204+
"type": "duckdb",
205+
"path": "./dev.duckdb"
228206
}
229207
}
230208
```
@@ -237,15 +215,13 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
237215

238216
```json
239217
{
240-
"warehouses": {
241-
"mysql-prod": {
242-
"type": "mysql",
243-
"host": "localhost",
244-
"port": 3306,
245-
"database": "analytics",
246-
"user": "analyst",
247-
"password": "{env:MYSQL_PASSWORD}"
248-
}
218+
"mysql-prod": {
219+
"type": "mysql",
220+
"host": "localhost",
221+
"port": 3306,
222+
"database": "analytics",
223+
"user": "analyst",
224+
"password": "{env:MYSQL_PASSWORD}"
249225
}
250226
}
251227
```
@@ -265,15 +241,13 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
265241

266242
```json
267243
{
268-
"warehouses": {
269-
"sqlserver-prod": {
270-
"type": "sqlserver",
271-
"host": "localhost",
272-
"port": 1433,
273-
"database": "analytics",
274-
"user": "sa",
275-
"password": "{env:MSSQL_PASSWORD}"
276-
}
244+
"sqlserver-prod": {
245+
"type": "sqlserver",
246+
"host": "localhost",
247+
"port": 1433,
248+
"database": "analytics",
249+
"user": "sa",
250+
"password": "{env:MSSQL_PASSWORD}"
277251
}
278252
}
279253
```
@@ -295,19 +269,17 @@ All warehouse types support SSH tunneling for connections behind a bastion host:
295269

296270
```json
297271
{
298-
"warehouses": {
299-
"prod-via-bastion": {
300-
"type": "postgres",
301-
"host": "10.0.1.50",
302-
"database": "analytics",
303-
"user": "analyst",
304-
"password": "{env:PG_PASSWORD}",
305-
"ssh_host": "bastion.example.com",
306-
"ssh_port": 22,
307-
"ssh_user": "ubuntu",
308-
"ssh_auth_type": "key",
309-
"ssh_key_path": "~/.ssh/id_rsa"
310-
}
272+
"prod-via-bastion": {
273+
"type": "postgres",
274+
"host": "10.0.1.50",
275+
"database": "analytics",
276+
"user": "analyst",
277+
"password": "{env:PG_PASSWORD}",
278+
"ssh_host": "bastion.example.com",
279+
"ssh_port": 22,
280+
"ssh_user": "ubuntu",
281+
"ssh_auth_type": "key",
282+
"ssh_key_path": "~/.ssh/id_rsa"
311283
}
312284
}
313285
```

docs/docs/getting-started.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,17 @@ Once complete, altimate indexes your schemas and detects your tooling, enabling
6464

6565
### Option B: Manual configuration
6666

67-
Add a warehouse connection to your `altimate-code.json`. Here's a quick example:
67+
Add a warehouse connection to `.altimate-code/connections.json`. Here's a quick example:
6868

6969
```json
7070
{
71-
"warehouses": {
72-
"snowflake": {
73-
"type": "snowflake",
74-
"account": "xy12345.us-east-1",
75-
"user": "your_user",
76-
"password": "${SNOWFLAKE_PASSWORD}",
77-
"warehouse": "COMPUTE_WH",
78-
"database": "ANALYTICS"
79-
}
71+
"snowflake": {
72+
"type": "snowflake",
73+
"account": "xy12345.us-east-1",
74+
"user": "your_user",
75+
"password": "${SNOWFLAKE_PASSWORD}",
76+
"warehouse": "COMPUTE_WH",
77+
"database": "ANALYTICS"
8078
}
8179
}
8280
```
@@ -120,7 +118,7 @@ Place `.altimate-code/altimate-code.json` in your dbt project root for project-s
120118
```
121119
my-dbt-project/
122120
.altimate-code/
123-
altimate-code.json # warehouse connections, model preferences
121+
altimate-code.json # providers, model preferences, permissions
124122
agents/ # custom agent prompts
125123
commands/ # custom slash commands
126124
plugins/ # custom plugins

0 commit comments

Comments
 (0)