Where do I insert a DB function to? getting syntax errors

Trying to insert the following function and getting syntax errors

create or replace function "CreateScrapedUpload" (
  _filename text,
  _record_count int,
) returns table (
  id uuid,
  filename text,
  storage_key text
  record_count int,
  notes text,
  checkbox boolean
) as $$
  insert into rr_upload (
    filename,
    storage_key,
    record_count,
    notes,
    checkbox,
  )
  select
    filename,
    extensions.uuid_generate_v4()
    _record_count
    _filename,
    "",
    false
  from public.rr_upload rr
  returning id, filename, storage_key;
$$ language sql volatile;


Error: Failed to create function: failed to create pg.functions: syntax error at or near ")"
unknown.png
Was this page helpful?