Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion data-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Upgrades resolve only the lockfile and restore the original manifest and lockfil
fails. Restart running previews after an upgrade. Apps must already use the published package;
`app upgrade` does not migrate local runtime copies or rewrite app source.

Version 0.69.0 removes operation `output` parsers: validate and return query results inside `run`.
After `app upgrade`, migrate existing app source and run `app lint`.

## Verify
Expand Down
2 changes: 1 addition & 1 deletion data-app/starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Start with the [authoring router](AGENTS.md) for data and view changes, or the [

Run `altertable app lint` to check the app locally. Use `altertable app lint --lakehouse` to execute each operation's declared `checks` against the selected profile.

`altertable app upgrade` pins the package version tested with your CLI and updates the lockfile. It preserves app code and does not downgrade a newer installed package. Restart a running preview after upgrading.
`altertable app upgrade` pins the package version tested with your CLI and updates the lockfile. It preserves app code and does not downgrade a newer installed package. Version 0.70.0 requires typed query parameters and projections, with decoded record rows; migrate existing query declarations after upgrading. Restart a running preview after upgrading.

## Version control

Expand Down
4 changes: 2 additions & 2 deletions data-app/starter/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions data-app/starter/fixtures/activity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineDataApp } from "@altertable/data-app";
import { defineDateRangeContract, parseCount, parseLabel } from "@altertable/data-app/contract";
import { defineDateRangeContract } from "@altertable/data-app/contract";

type Activity = { count: number; features: string[] };
export const app = defineDataApp({
Expand All @@ -10,7 +10,8 @@ export const app = defineDataApp({
queries: {
activity: {
statement: "SELECT 120 AS count, 'Queries' AS feature WHERE $start <= $end",
params: { start: {}, end: {} },
params: { start: { type: "string" }, end: { type: "string" } },
projections: { count: { type: "number" }, feature: { type: "string" } },
},
},
});
Expand All @@ -31,9 +32,11 @@ export const operations = {
{ start: input.range.start, end: input.range.end },
{ limit: 10 },
);
const firstRow = result.rows[0];
if (!firstRow) throw new Error("Activity query returned no rows.");
return {
count: parseCount(result.rows[0]?.[0]),
features: result.rows.map((row) => parseLabel(row[1])),
count: firstRow.count,
features: result.rows.map((row) => row.feature),
};
},
}),
Expand Down
8 changes: 7 additions & 1 deletion data-app/starter/fixtures/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const app = defineDataApp({
description: "Completed orders in production.",
scope: { organization: "Acme", environment: "production" },
appearance: { theme: "light" },
queries: { connection: { statement: "SELECT 1 AS connection_check", params: {} } },
queries: {
connection: {
statement: "SELECT 1 AS connection_check",
params: {},
projections: { connection_check: { type: "number" } },
},
},
});
const operations = { connection: connectionCheck(app.queries) };
const connectionQueryNames = operations.connection.queryNames;
Expand Down
2 changes: 1 addition & 1 deletion data-app/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "bun build src/index.html --outdir=dist --production"
},
"dependencies": {
"@altertable/data-app": "0.69.0",
"@altertable/data-app": "0.70.0",
"react": "19.3.0",
"react-dom": "19.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions data-app/starter/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineDataApp({
connection: {
statement: "SELECT 1 AS connection_check",
params: {},
projections: { connection_check: { type: "number" } },
},
},
});
4 changes: 2 additions & 2 deletions data-app/tests/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data-app/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"typescript": "7.0.2"
},
"dependencies": {
"@altertable/data-app": "0.69.0"
"@altertable/data-app": "0.70.0"
}
}
Loading