Skip to content

Commit be90c8d

Browse files
authored
ENG-1162: fix importing default column functions (#2956)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Ensures ClickHouse DEFAULT expressions are used as-is (no extra quoting) in DDL/ALTER generation and adds Python/TypeScript e2e tests verifying db-pull roundtrip with function defaults. > > - **ClickHouse DDL generation (Rust)**: > - Use defaults verbatim in `ALTER TABLE ... MODIFY COLUMN` and `CREATE TABLE` paths (`apps/framework-cli/src/infrastructure/olap/clickhouse.rs`, `.../queries.rs`). > - Remove extra formatting/quoting for defaults; preserve literals `'...'`, numbers, and SQL functions (`xxHash64(_id)`, `now()`, `today()`). > - Add unit tests for function defaults in both `MODIFY COLUMN` and `CREATE TABLE` flows. > - **E2E tests**: > - Add comprehensive Python and TypeScript db-pull tests validating generated model defaults and successful migrate/apply with function and literal defaults (`apps/framework-cli-e2e/test/db-pull-defaults.test.ts`). > - Include special-character default cases. > - **Schema utils**: > - Update ClickHouse schema introspection field from `default_kind` to `default_type` (`apps/framework-cli-e2e/test/utils/database-utils.ts`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3ab0104. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent ad86210 commit be90c8d

File tree

4 files changed

+873
-14
lines changed

4 files changed

+873
-14
lines changed

0 commit comments

Comments
 (0)