Skip to content

Conversation

@jsdt
Copy link
Contributor

@jsdt jsdt commented Dec 10, 2025

Description of Changes

This improves the type safety a bit from #3812.

The core change is that the previous version typed queries based on the typescript type, not the spacetime type. This meant that we allowed queries for incorrect tables, like a table that had the same column names and types, but had a u32 instead of a u64 somewhere.

This still has an issue with allowing results from tables where the rows are reordered, which would actually be a problem, but hopefully that is not too common.

API and ABI breaking changes

This is technically a breaking change, because it changes some type parameters. I don't think people should be relying on these though, so I don't think we should be worried about breaking them.

This would only cause new type errors for apps that are likely to error at runtime anyway.

Expected complexity level and risk

1.5. This should be low risk, since it is just a typing change.

Testing

This has some type checks in view.test-d.ts, and I've done some manual e2e testing.

@bfops bfops added the release-any To be landed in any release window label Dec 15, 2025
Copy link
Collaborator

@coolreader18 coolreader18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jsdt jsdt added this pull request to the merge queue Dec 16, 2025
Merged via the queue into master with commit 12fe021 Dec 16, 2025
27 checks passed
@jsdt jsdt deleted the jsdt/ts-query-tightening branch December 16, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants