Skip to content
Discussion options

You must be logged in to vote

Computed columns look fit for this case. Though they usually "compute" a value based on other columns they can also be used for constants.

CREATE FUNCTION "exampleNum"(my_table) RETURNS int AS $$
  SELECT 42;
$$ LANGUAGE SQL;
await supabase
.from('my_table')
.select(`
  id,
  ...,
  exampleNum
`);

//Result:
table = {
  id: 1,
  ...,
  exampleNum: 42
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@JVariance
Comment options

Comment options

You must be logged in to vote
1 reply
@JVariance
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by steve-chavez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants