cli icon indicating copy to clipboard operation
cli copied to clipboard

Remove generated columns from Insert/Update types

Open dreinon opened this issue 2 years ago • 1 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When creating a generated column, it is treated as a regular column in the Studio UI but also when generating TS types. It should be removed from Insert/Update types.

To Reproduce

  1. Create table with generated column:
CREATE TABLE people (
    ...,
    height_cm numeric,
    height_in numeric GENERATED ALWAYS AS (height_cm / 2.54) STORED
);
  1. Setup a CLI and generate types.

Expected behavior

Generated columns do not appear in Insert/Update types.

dreinon avatar Nov 29 '23 13:11 dreinon

It looks like we should add a filter for template?

S96EA avatar Nov 30 '23 03:11 S96EA