Skip to content

fix(typegen): omit generated columns from Insert and Update types - #1104

Closed
daviddallakyan2005 wants to merge 2 commits into
supabase:masterfrom
daviddallakyan2005:fix/typegen-omit-generated-columns
Closed

fix(typegen): omit generated columns from Insert and Update types#1104
daviddallakyan2005 wants to merge 2 commits into
supabase:masterfrom
daviddallakyan2005:fix/typegen-omit-generated-columns

Conversation

@daviddallakyan2005

@daviddallakyan2005 daviddallakyan2005 commented Aug 14, 2026

Copy link
Copy Markdown

Fixes #838

Stored GENERATED ALWAYS AS … STORED columns are not writable, but TypeScript typegen only excluded identity-ALWAYS columns. is_generated is already populated by column introspection; Insert/Update now treat it the same way and emit field?: never, while the column remains on Row. Go, Swift, and Python generators are separate and still include generated columns — this PR is TypeScript-only.

How to test

npm install
npm test

npm test starts Postgres via test/db/docker-compose.yml (Docker required) and runs Vitest. Use Node 22 (.nvmrc). The new assertion is typegen: typescript omits generated columns from Insert and Update against fixture table public.people.

Stored GENERATED columns are not writable, but TypeScript typegen only
excluded identity-ALWAYS columns. Treat is_generated the same way.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@daviddallakyan2005

Copy link
Copy Markdown
Author

Closing to replace with a single-commit PR.

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.

Remove generated columns from Insert/Update types

1 participant