Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
wyozi opened this issue Nov 6, 2024 · 0 comments
Open
2 tasks done

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

wyozi opened this issue Nov 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wyozi
Copy link
Contributor

wyozi commented Nov 6, 2024

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",
@wyozi wyozi added the bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant