Repository navigation
Conversation
0.29 rejects limit(sql.raw(...)), so lagHistory and rawLimit use limit(sql.lit()), which compiles to the same literal limit. rawLimit no longer goes through kysely's end-modifier path, which calls Array.prototype.toSorted (missing in Chrome 109). kysely-codegen 0.18 renamed --schema to --default-schema.
def-
approved these changes
Nov 6, 2026
leedqin
added a commit
to leedqin/materialize
that referenced
this pull request
Nov 6, 2026
kysely 0.28.17 -> 0.29.8 and kysely-codegen 0.17 -> 0.20.0. Supersedes MaterializeInc#39686. 0.29 rejects limit(sql.raw(...)), so rawLimit and the lag history limit call query.limit(sql.lit(n)). rawLimit used modifyEnd before, and 0.29 sorts end modifiers with Array.prototype.toSorted, which Chrome 109 lacks. Neither rawLimit caller has an OFFSET or another end modifier, so the compiled SQL is unchanged. kysely-codegen 0.20 renames generate's schemas option to defaultSchemas, lists materialized views itself, and writes to a default file in node_modules unless outFile is null. kysely 0.29's TableMetadata adds isForeign. The generated types are identical to 0.17's.
leedqin
added a commit
that referenced
this pull request
Nov 6, 2026
### Motivation `yarn gen:types` fails with `function "pg_get_serial_sequence" does not exist`. kysely-codegen runs kysely's Postgres introspector for its table query. Since the bump to kysely 0.28 (#35669), that query calls `pg_get_serial_sequence`, which Materialize lacks. kysely 0.29 still does. The query also lists only relkinds `r`, `v` and `p`, so the catalog's builtin materialized views (`m`) never reached the types under kysely-codegen 0.17. #40044's types were generated with both patched by hand in `node_modules`. This also bumps kysely to 0.29 and kysely-codegen to 0.20, superseding #39686. ### Description - `bin/kysely-codegen.ts` runs kysely-codegen programmatically with an introspector that overrides only the table query. kysely-codegen's materialized view query, enum handling and serializer still apply. - The script writes the copyright header to `types/materialize.d.ts`. The codegen output lacks it, and the copyright lint fails without it. - `bin/generate-types` exits on errors, pulls the requested image (a cached `latest` went stale), and stops the container on exit. Before, each run left a container bound to port 6875, and the next run generated types from that old container. - kysely 0.28.17 → 0.29.8 and kysely-codegen 0.17 → 0.20.0: - 0.29 rejects `limit(sql.raw(...))`. `rawLimit` and the lag history limit now call `query.limit(sql.lit(n))`, which still inlines the limit as a literal, as Materialize requires. - `rawLimit` used to append its limit with `modifyEnd`. In 0.29, compiling end modifiers calls `Array.prototype.toSorted`, which Chrome 109 lacks. No console query uses end modifiers now. Neither `rawLimit` caller has an OFFSET or another end modifier, so the compiled SQL is unchanged. - kysely 0.29 is ESM-only and kysely-codegen 0.20 `require`s it, so `yarn gen:types` needs Node 22.12 or later. CI and the Volta pin run Node 26, and #39683 updates `engines.node`. - `types/materialize.d.ts` is regenerated against v26.49.1. kysely-codegen 0.17 and 0.20 produce identical output. - Adds `mz_builtin_columns` and `mz_builtin_index_columns`. - Builtin columns lose their `Generated<>` wrappers, because #40316 changed `pg_attribute.atthasdef` to report no default for them. The console only selects from these relations, where `Generated<T>` and `T` read the same. - Drops the two hand-added `TODO` markers from #39992. The generator now emits `mz_cluster_auto_scaling_strategies` and `mz_cluster_reconfigurations`, and `AUTO_SCALING_MIN_VERSION` still gates them at runtime. The file is now exactly the generator output. Worth checking on the preview, since these run the changed limits: - the Query History list; - a sink's Errors tab; - the freshness lag charts on the environment overview and the cluster pages. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor
Author
|
Closed becaue I fixed yarn gen:types here: #40550 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Supersedes #39534. Dependabot's version of this bump fails typecheck, and it would break
yarn gen:types.Description
limit(sql.raw(...)).lagHistoryand ourrawLimithelper now uselimit(sql.lit(n)). The compiled SQL is unchanged: the limit is still inlined as a literal, which Materialize requires.rawLimitused to append its limit withmodifyEnd. In 0.29, compiling end modifiers callsArray.prototype.toSorted, which Chrome 109 (still in our browserslistdefaults) doesn't have. With the old helper, the Query History list and sink errors would throw there. The API tokens page already callstoSortedon main, so Chrome 109 isn't fully supported either way. This just avoids adding more breakage.--schemato--default-schema, and 0.20 rejects the old flag, sobin/generate-typesis updated.kysely 0.29 is ESM-only, and kysely-codegen 0.20
requires it, soyarn gen:typesneeds Node 22.12 or later. CI and the Volta pin already run Node 26, and #39683 updatesengines.node.Verification
Existing tests, including the SQL builder tests under
src/api. I also compiled 64 query shapes (everyrawLimitcaller, the Query History filters, all lag-history branches, the replica utilization subscribes and the Object Explorer queries) on 0.28 with the old code and on 0.29 with the new code. The SQL text and parameters matched exactly.Worth checking on the preview:
🤖 Generated with Claude Code