Skip to content

Type checker for upsert/insert do not warn of nonexistent columns #1649

@wyozi

Description

@wyozi

Bug report

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

Describe the bug

.insert and .upsert do not warn if the object includes a nonexistent column, whereas TablesInsert type used directly does

To Reproduce

postgrest.from("users").insert({ name: "James", i_dont_exist: "xyz" })

does not error even if

const payload: TablesInsert<"users"> = {
  name: "James",
  i_dont_exist: "xyz",
};

would

Expected behavior

The insert/upsert methods would cause type errors when passing nonexistent columns

System information

  • "@supabase/supabase-js": "2.46.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpostgrest-jsRelated to the postgrest-js library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions