Skip to content

Commit ae7ecca

Browse files
authored
Merge branch 'main' into feat/skill-followup-suggestions
2 parents 970b3c7 + 33c331b commit ae7ecca

75 files changed

Lines changed: 8722 additions & 104 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/meta/commit.txt‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
release: v0.5.11
1+
fix: remove flaky `setTimeout` in todo bus event test
22

3-
Update README changelog to reflect releases v0.5.1 through v0.5.11.
4-
Previous README only listed up to v0.5.0, missing 10 versions of features
5-
including `check` CLI, skill management, session tracing, Codespaces support,
6-
impact analysis, Snowflake Cortex, MCP auto-discovery, and more.
3+
`Bus.publish` is synchronous — the event is delivered immediately,
4+
no 50ms delay needed. Removes resource contention risk in parallel CI.
75

86
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- 'packages/opencode/src/altimate/native/connections/**'
4646
- 'packages/opencode/test/altimate/drivers-e2e.test.ts'
4747
- 'packages/opencode/test/altimate/drivers-docker-e2e.test.ts'
48+
- 'packages/opencode/test/altimate/drivers-mongodb-e2e.test.ts'
4849
- 'packages/opencode/test/altimate/connections.test.ts'
4950
dbt-tools:
5051
- 'packages/dbt-tools/**'
@@ -155,6 +156,16 @@ jobs:
155156
--health-timeout 5s
156157
--health-retries 10
157158
159+
mongodb:
160+
image: mongo:7.0
161+
ports:
162+
- 27017:27017
163+
options: >-
164+
--health-cmd "mongosh --eval 'db.runCommand({ping:1})' --quiet"
165+
--health-interval 5s
166+
--health-timeout 5s
167+
--health-retries 10
168+
158169
steps:
159170
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
160171

@@ -195,6 +206,13 @@ jobs:
195206
TEST_REDSHIFT_PORT: "15439"
196207
TEST_REDSHIFT_PASSWORD: testpass123
197208

209+
- name: Run MongoDB driver E2E
210+
run: bun test test/altimate/drivers-mongodb-e2e.test.ts
211+
working-directory: packages/opencode
212+
env:
213+
TEST_MONGODB_HOST: 127.0.0.1
214+
TEST_MONGODB_PORT: "27017"
215+
198216
# Cloud tests NOT included — they require real credentials
199217
# Run locally with:
200218
# ALTIMATE_CODE_CONN_SNOWFLAKE_TEST='...' bun test test/altimate/drivers-snowflake-e2e.test.ts

‎bun.lock‎

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/docs/configure/warehouses.md‎

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Warehouses
22

3-
Altimate Code connects to 8 warehouse types. Configure them in `.altimate-code/connections.json` (project-local) or `~/.altimate-code/connections.json` (global).
3+
Altimate Code connects to 9 warehouse types. Configure them in `.altimate-code/connections.json` (project-local) or `~/.altimate-code/connections.json` (global).
44

55
## Configuration
66

@@ -237,6 +237,51 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
237237
| `ssl_cert` | No | Path to client certificate file |
238238
| `ssl_key` | No | Path to client key file |
239239

240+
## MongoDB
241+
242+
```json
243+
{
244+
"my-mongodb": {
245+
"type": "mongodb",
246+
"host": "localhost",
247+
"port": 27017,
248+
"database": "analytics",
249+
"user": "analyst",
250+
"password": "{env:MONGO_PASSWORD}"
251+
}
252+
}
253+
```
254+
255+
| Field | Required | Description |
256+
|-------|----------|-------------|
257+
| `connection_string` | No | Full connection string (alternative to individual fields) |
258+
| `host` | No | Hostname (default: `127.0.0.1`) |
259+
| `port` | No | Port (default: `27017`) |
260+
| `database` | No | Database name |
261+
| `user` | No | Username |
262+
| `password` | No | Password |
263+
| `auth_source` | No | Authentication database (default: `admin`) |
264+
| `replica_set` | No | Replica set name |
265+
| `tls` | No | Enable TLS (default: `false`) |
266+
| `direct_connection` | No | Connect directly to a single host |
267+
268+
### Using a connection string
269+
270+
```json
271+
{
272+
"my-mongodb": {
273+
"type": "mongodb",
274+
"connection_string": "mongodb://analyst:secret@localhost:27017/analytics"
275+
}
276+
}
277+
```
278+
279+
!!! note
280+
MongoDB uses MQL (MongoDB Query Language) instead of SQL. Queries are submitted as JSON objects via the `execute` method. Supported commands: `find`, `aggregate`, `countDocuments`, `distinct`, `insertOne`, `insertMany`, `updateOne`, `updateMany`, `deleteOne`, `deleteMany`, `createIndex`, `listIndexes`, `createCollection`, `dropCollection`, `ping`.
281+
282+
!!! info "Server compatibility"
283+
The MongoDB driver (v6.x) supports MongoDB server versions 3.6 through 8.0, covering all releases from the last 3+ years.
284+
240285
## SQL Server
241286

242287
```json

‎docs/docs/data-engineering/tools/warehouse-tools.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ env_bigquery | bigquery | GOOGLE_APPLICATION_CREDENTIALS
7070
| Databricks | `DATABRICKS_HOST`, `DATABRICKS_SERVER_HOSTNAME` |
7171
| PostgreSQL | `PGHOST`, `PGDATABASE`, `DATABASE_URL` |
7272
| MySQL | `MYSQL_HOST`, `MYSQL_DATABASE` |
73+
| MongoDB | `MONGODB_URI`, `MONGO_URL` |
7374
| Redshift | `REDSHIFT_HOST` |
7475

7576
### Parameters
@@ -164,7 +165,7 @@ Remove an existing warehouse connection.
164165

165166
## warehouse_discover
166167

167-
Discover database containers running in Docker. Detects PostgreSQL, MySQL/MariaDB, and SQL Server containers with their connection details.
168+
Discover database containers running in Docker. Detects PostgreSQL, MySQL/MariaDB, SQL Server, and MongoDB containers with their connection details.
168169

169170
```
170171
> warehouse_discover

‎docs/docs/drivers.md‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
Altimate Code connects to 10 databases natively via TypeScript drivers. No Python dependency required. Drivers are loaded lazily, so only the driver you need is imported at runtime.
5+
Altimate Code connects to 11 databases natively via TypeScript drivers. No Python dependency required. Drivers are loaded lazily, so only the driver you need is imported at runtime.
66

77
## Support Matrix
88

@@ -17,6 +17,7 @@ Altimate Code connects to 10 databases natively via TypeScript drivers. No Pytho
1717
| Snowflake | `snowflake-sdk` | Password, Key-Pair (unencrypted + encrypted), OAuth | ✅ Live account | 37 E2E tests, key-pair with passphrase support |
1818
| BigQuery | `@google-cloud/bigquery` | Service Account, ADC | ✅ Live account | 25 E2E tests, UNNEST/STRUCT/DATE types |
1919
| Databricks | `@databricks/sql` | PAT, OAuth | ✅ Live account | 24 E2E tests, Unity Catalog support |
20+
| MongoDB | `mongodb` | Password, Connection String | ✅ Docker | 90 E2E tests, MQL queries, aggregation pipelines |
2021
| Oracle | `oracledb` (thin) | Password | ❌ Needs Oracle 12.1+ | Thin mode only, no Instant Client |
2122

2223
## Installation
@@ -33,6 +34,9 @@ bun add pg # PostgreSQL + Redshift
3334
bun add mysql2 # MySQL
3435
bun add mssql # SQL Server
3536

37+
# Document databases
38+
bun add mongodb # MongoDB
39+
3640
# Cloud warehouses
3741
bun add snowflake-sdk # Snowflake
3842
bun add @google-cloud/bigquery # BigQuery
@@ -129,6 +133,14 @@ altimate-dbt init --project-root /path/to/dbt/project --python-path $(which pyth
129133
|--------|--------------|
130134
| Password | `host`, `port`, `service_name`, `user`, `password` |
131135

136+
### MongoDB
137+
| Method | Config Fields |
138+
|--------|--------------|
139+
| Password | `host`, `port`, `database`, `user`, `password` |
140+
| Connection String | `connection_string: "mongodb://user:pass@host:port/db"` |
141+
142+
MongoDB supports server versions 3.6 through 8.0. Queries use MQL (MongoDB Query Language) via JSON, not SQL. The driver supports `find`, `aggregate`, CRUD operations, index management, and schema introspection via document sampling.
143+
132144
### DuckDB
133145
| Method | Config Fields |
134146
|--------|--------------|
@@ -167,7 +179,7 @@ SSH auth types: `"key"` (default) or `"password"` (set `ssh_password`).
167179

168180
The CLI auto-discovers connections from:
169181

170-
1. **Docker containers**: detects running PostgreSQL, MySQL, MariaDB, SQL Server, Oracle containers
182+
1. **Docker containers**: detects running PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, MongoDB containers
171183
2. **dbt profiles**: parses `~/.dbt/profiles.yml` for all supported adapters
172184
3. **Environment variables**: detects `SNOWFLAKE_ACCOUNT`, `PGHOST`, `MYSQL_HOST`, `MSSQL_HOST`, `ORACLE_HOST`, `DUCKDB_PATH`, `SQLITE_PATH`, etc.
173185

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { describe, test, expect, beforeEach } from "bun:test"
2+
import { bufferLog, getRecentDbtLogs, clearDbtLogs } from "../src/log-buffer"
3+
4+
describe("dbt log-buffer", () => {
5+
beforeEach(() => {
6+
clearDbtLogs()
7+
})
8+
9+
test("buffers log messages in insertion order", () => {
10+
bufferLog("first")
11+
bufferLog("second")
12+
bufferLog("third")
13+
expect(getRecentDbtLogs()).toEqual(["first", "second", "third"])
14+
})
15+
16+
test("evicts oldest entries when buffer exceeds 100", () => {
17+
for (let i = 0; i < 105; i++) {
18+
bufferLog(`msg-${i}`)
19+
}
20+
const logs = getRecentDbtLogs()
21+
expect(logs).toHaveLength(100)
22+
expect(logs[0]).toBe("msg-5")
23+
expect(logs[99]).toBe("msg-104")
24+
})
25+
26+
test("clearDbtLogs empties the buffer", () => {
27+
bufferLog("something")
28+
clearDbtLogs()
29+
expect(getRecentDbtLogs()).toEqual([])
30+
})
31+
32+
test("getRecentDbtLogs returns a copy, not a reference", () => {
33+
bufferLog("original")
34+
const copy = getRecentDbtLogs()
35+
copy.push("injected")
36+
expect(getRecentDbtLogs()).toEqual(["original"])
37+
})
38+
39+
test("handles empty buffer", () => {
40+
expect(getRecentDbtLogs()).toEqual([])
41+
})
42+
43+
test("buffer stays at exactly 100 after repeated overflow", () => {
44+
for (let i = 0; i < 200; i++) {
45+
bufferLog(`msg-${i}`)
46+
}
47+
expect(getRecentDbtLogs()).toHaveLength(100)
48+
expect(getRecentDbtLogs()[0]).toBe("msg-100")
49+
expect(getRecentDbtLogs()[99]).toBe("msg-199")
50+
})
51+
})

‎packages/drivers/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"mysql2": "^3.0.0",
1717
"mssql": "^11.0.0",
1818
"oracledb": "^6.0.0",
19-
"duckdb": "^1.0.0"
19+
"duckdb": "^1.0.0",
20+
"mongodb": "^6.0.0"
2021
}
2122
}

‎packages/drivers/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Re-export types
22
export type { Connector, ConnectorResult, SchemaColumn, ConnectionConfig } from "./types"
33

4-
54
// Re-export config normalization
65
export { normalizeConfig } from "./normalize"
76

@@ -16,3 +15,4 @@ export { connect as connectSqlserver } from "./sqlserver"
1615
export { connect as connectOracle } from "./oracle"
1716
export { connect as connectDuckdb } from "./duckdb"
1817
export { connect as connectSqlite } from "./sqlite"
18+
export { connect as connectMongodb } from "./mongodb"

0 commit comments

Comments
 (0)