Skip to content

Release 0.3.1: Rename Column in place on every SQL engine, README, release notes - #600

Merged
huyplb merged 4 commits into
mainfrom
feat/column-change-direct-alter
Nov 8, 2026
Merged

huyplb merged 4 commits into
mainfrom
feat/column-change-direct-alter

Conversation

@huyplb

@huyplb huyplb commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Ships 0.3.1. The last commit is chore: release 0.3.1, so the version-bump workflow skips this merge and main stays at 0.3.1 for the v0.3.1 tag.

Rename Column (Utilities)

  • A type change is one in-place ALTER by default. The add / copy / switch-over plan is now an opt-in Large table mode (PostgreSQL, YugabyteDB, CockroachDB, MySQL, MariaDB, TiDB, SQL Server, Azure SQL).
  • Size warning from the catalog estimate (about 1M rows or 1 GB) pointing at Large table mode. The data-loss check stays.
  • A type change alone shows one-line "may use" warnings for routines; line-by-line references are for a rename.
  • Per engine:
    • PostgreSQL family: ALTER … TYPE, adding USING only when the kind of type changes. With USING, CockroachDB refused an indexed column.
    • MySQL family: MODIFY, restating NOT NULL, the default, the collation and the comment.
    • SQL Server: one transaction that scripts the column's indexes from sys.indexes when it runs, so filters, INCLUDE and DESC survive. Large-table mode moves filtered indexes at the switch-over, because sp_rename refuses a column a filter names.
  • Six engines added:
    • Oracle: MODIFY.
    • Db2: SET DATA TYPE, then a REORG.
    • SQLite: rename only.
    • DuckDB: refused while the table has an index.
    • Redshift: only lengthening a VARCHAR.
    • ClickHouse: MODIFY COLUMN, keeping Nullable; sorting-key columns refused.
  • Each engine can refuse a change it cannot make, with the reason, before any SQL is shown.

Docs

  • README and npm README: What's in 0.3, an Update section, and the placeholder banner removed.
  • docs/releases/RELEASE_0.3.1.md (the update toast's "What's new" page), SUMMARY entry, UNRELEASED reset.
  • Feature map refreshed (Rename Column card, 163 routes, re-measured counts), user guide, plan doc, DIALECTS.md.

Verification

  • apps/web tsc clean; npx vitest run: 7,002 passed.
  • New tests failed on the old code (A/B).
  • Run live through Fox's own reader, planner, splitter and drivers on PostgreSQL, MySQL, MariaDB, TiDB, SQL Server, CockroachDB, Oracle, Db2, SQLite, DuckDB and ClickHouse.
  • Not run live:
    • Redshift: the local container is plain PostgreSQL.
    • YugabyteDB: its container is stuck.
  • The lockfile changes only the five version fields; npm ci --dry-run passes.

🤖 Generated with Claude Code


Note

Medium Risk
The PR changes generated DDL and optional in-app execution across many database engines; mistakes could block writes or mishandle indexes/constraints, though coverage is expanded (sql/web tests) and the diff documents live dialect runs.

Overview
Releases 0.3.1 and retools Utilities → Rename Column so a type change defaults to a single in-place ALTER, with the previous add/copy/switch plan available only when Large table mode is checked (eight engines). The panel loads catalog row/size estimates for a warning around ~1M rows or 1 GB, hides batch sizing unless large-table mode is on, and branches run/status messaging on a new rename / direct / copy plan mode.

The @foxschema/sql planner gains per-dialect alterTypeSteps, optional refuse reasons, columnChangeLargeTable, and six more dialect registrations (Oracle, Db2, SQLite, DuckDB, Redshift, ClickHouse), with engine-specific behavior called out in docs (e.g. SQL Server index scripting from the catalog, PostgreSQL view blocking, DuckDB indexed-table refusal). Type-shape logic moves to column-type-shape.ts for lossy conversion across dialects.

README, CLI README, 0.3.1 release notes, feature map counts, user guide, and tests/docs inventory are updated to match; unreleased notes are cleared into RELEASE_0.3.1.md.

Reviewed by Cursor Bugbot for commit 8e55e5a. Bugbot is set up for automated code reviews on this repo. Configure here.

huyplb and others added 3 commits November 8, 2026 14:47
…engine

A type change is now one in-place ALTER by default; the add / copy /
switch-over plan becomes an opt-in Large table mode on the eight engines
that have it. A size warning from the catalog estimate points at it from
about a million rows or 1 GB. A type change alone lists routines as
one-line warnings; the line-by-line references are for a rename.

- PostgreSQL family: ALTER ... TYPE, with USING only across kinds
  (CockroachDB refused to rewrite an indexed column for an explicit USING).
- MySQL family: MODIFY restating NOT NULL, default, collation and the
  comment read from the catalog.
- SQL Server: one transaction that scripts the column's indexes from
  sys.indexes at run time (filters, INCLUDE, DESC kept, INCLUDE-only and
  filter-only indexes found) and puts them back; large-table mode moves
  filtered indexes at the switch-over, since sp_rename refuses a column a
  filter names.
- New: Oracle, Db2 (+ REORG), SQLite (rename only), DuckDB (refused while
  the table has an index), Redshift (VARCHAR lengthening), ClickHouse
  (Nullable kept, sorting key refused). A dialect can refuse a change with
  its reason before any SQL is shown.

Run live on PostgreSQL, MySQL, MariaDB, TiDB, SQL Server, CockroachDB,
Oracle, Db2, SQLite, DuckDB and ClickHouse. Feature map refreshed (163
routes, counts re-measured).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… READMEs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Test IDs

Added (1)

  • column-change-large-table

{…} is a part filled in at run time. The full tree: docs/testing/TEST_IDS.md.

@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 845c163e-f0a2-4b04-bb08-aa1f0cc54e13)

security/detect-unsafe-regex flagged the one-pattern parse in CI. Split
the name and the optional "(n)" by hand; same results, tests unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 28b6f6b6-5b03-4b4b-acee-da069db91963)

@huyplb
huyplb merged commit 70a781c into main Nov 8, 2026
13 checks passed
@huyplb
huyplb deleted the feat/column-change-direct-alter branch November 8, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant