Skip to content

Commit 41aaa0c

Browse files
committed
docs: add schema evolution section to DataFrame API — addColumn, dropColumn
1 parent 06d6a3c commit 41aaa0c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/src/content/docs/dataframe-api.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,34 @@ descriptorToCode(someDescriptor)
253253

254254
Handles all features: filters (all 14 ops with shorthand methods), aggregates, groupBy, joins, window functions, set operations, vector search, distinct, sort, limit/offset, version, cache, computed columns, pipe stages.
255255

256+
## Schema evolution
257+
258+
Add or drop columns on an existing dataset:
259+
260+
```typescript
261+
// Add a column with a default value (applied to all existing rows)
262+
await qm.table("users").addColumn("tier", "utf8", "free")
263+
264+
// Add a nullable column (default: null)
265+
await qm.table("users").addColumn("notes", "utf8")
266+
267+
// Drop a column
268+
await qm.table("users").dropColumn("legacy_field")
269+
```
270+
271+
Both return a `SchemaEvolutionResult`:
272+
273+
```typescript
274+
{
275+
table: "users",
276+
operation: "add_column", // or "drop_column"
277+
column: "tier",
278+
columnsAfter: ["id", "name", "email", "tier"]
279+
}
280+
```
281+
282+
Schema changes apply to the in-memory dataset (MaterializedExecutor). On edge mode, schema evolution coordinates through MasterDO.
283+
256284
## Progress tracking
257285

258286
For long-running queries, track progress with a callback:

0 commit comments

Comments
 (0)