This is piggy backing off of this Question. Is there an easier method to implement the SQL statement "INSERT INTO" to an entire table without manually specifying table columns?
When using INSERT INTO you can just type the Table name without specifying the columns, but you still have to type each columns' data individually it seems.
Is it possible to just insert a Object that contains all of the columns?
I am using a supabase function, and for the arguments I can specify the Type of the object recieved. In the API that calls the function, I create a new Row entry for the table, populate all of the columns and send the entire Row Entry to the Database function!
The Database function recieves the entire row as one argument.
Shouldnt I be able to insert this Entire Object without typing out each column?
create or replace function test_function(data table_type)
insert into table_type
values (data); -- <= This should be possible but it errors
-- and seems to be trying to put the entire object just in the first column!