monsto
05/02/2022, 6:17 PMNeedle
05/02/2022, 6:17 PMmonsto
05/02/2022, 6:17 PM; ({ data } = await supabase
.rpc("gen_report_epr", {
daterange_start: dateFrom.toISOString(),
daterange_end: dateTo.toISOString(),
})
)
rpc sql
create temporary table temp_ouput_epr as (select * from electronic_purchase_report) with no data;
create or replace function gen_report_epr(daterange_start date, daterange_end date)
returns setof temp_ouput_epr
as $BODY$
select * from electronic_purchase_report where created_at between daterange_start and daterange_end
$BODY$ language sql;
monsto
05/02/2022, 6:18 PM.rpc()
2nd arg, is it supposed to be a fully formed object, or is it something else?monsto
05/02/2022, 6:20 PMgaryaustin
05/02/2022, 6:37 PMmonsto
05/02/2022, 6:39 PMgaryaustin
05/02/2022, 6:40 PMmonsto
05/02/2022, 6:45 PMmonsto
05/02/2022, 6:45 PMmonsto
05/02/2022, 6:46 PMmonsto
05/02/2022, 6:47 PMmonsto
05/02/2022, 6:47 PMgaryaustin
05/02/2022, 6:48 PMmonsto
05/02/2022, 6:49 PMmonsto
05/02/2022, 6:50 PMgaryaustin
05/02/2022, 6:52 PMmonsto
05/02/2022, 6:53 PMgaryaustin
05/02/2022, 6:53 PMmonsto
05/02/2022, 6:55 PMgaryaustin
05/02/2022, 6:55 PMmonsto
05/02/2022, 6:55 PMmonsto
05/02/2022, 7:00 PMgaryaustin
05/02/2022, 7:00 PMmonsto
05/02/2022, 7:01 PMgaryaustin
05/02/2022, 7:01 PMgaryaustin
05/02/2022, 7:01 PMmonsto
05/02/2022, 7:01 PMmonsto
05/02/2022, 7:01 PMmonsto
05/02/2022, 7:03 PMgaryaustin
05/02/2022, 7:04 PMmonsto
05/02/2022, 7:05 PMmonsto
05/02/2022, 7:05 PMpublic.gen_report_epr
equivalent. does that matter?garyaustin
05/02/2022, 7:06 PMgaryaustin
05/02/2022, 7:06 PMmonsto
05/02/2022, 7:06 PMmonsto
05/02/2022, 7:07 PMgaryaustin
05/02/2022, 7:09 PMmonsto
05/02/2022, 7:10 PMmonsto
05/02/2022, 7:10 PMgaryaustin
05/02/2022, 7:10 PMmonsto
05/02/2022, 7:11 PMmonsto
05/02/2022, 7:12 PMgaryaustin
05/02/2022, 7:12 PMmonsto
05/02/2022, 7:12 PMgaryaustin
05/02/2022, 7:13 PMmonsto
05/02/2022, 7:14 PMmonsto
05/02/2022, 7:15 PMgaryaustin
05/02/2022, 7:15 PMgaryaustin
05/02/2022, 7:15 PMmonsto
05/02/2022, 7:15 PMgaryaustin
05/02/2022, 7:16 PMgaryaustin
05/02/2022, 7:16 PMmonsto
05/02/2022, 7:16 PMmonsto
05/02/2022, 7:16 PMgaryaustin
05/02/2022, 7:17 PMmonsto
05/02/2022, 7:18 PMmonsto
05/02/2022, 7:18 PMgaryaustin
05/02/2022, 7:18 PMmonsto
05/02/2022, 7:19 PMcreate temporary table temp_ouput_epr as (select * from electronic_purchase_report) with no data;
create function gen_report_epr(daterange_start date, daterange_end date)
returns setof temp_ouput_epr
as $BODY$
select * from electronic_purchase_report where created_at between daterange_start and daterange_end
$BODY$ language sql;
garyaustin
05/02/2022, 7:19 PMmonsto
05/02/2022, 7:20 PMmonsto
05/02/2022, 7:20 PMmonsto
05/02/2022, 7:20 PMmonsto
05/02/2022, 7:21 PMgaryaustin
05/02/2022, 7:21 PMmonsto
05/02/2022, 7:22 PMmonsto
05/02/2022, 7:22 PMmonsto
05/02/2022, 7:23 PMmonsto
05/02/2022, 7:23 PMgaryaustin
05/02/2022, 8:29 PMmonsto
05/02/2022, 8:41 PMgaryaustin
05/02/2022, 8:44 PMmonsto
05/02/2022, 8:45 PMmonsto
05/02/2022, 8:46 PMmonsto
05/02/2022, 8:46 PMgaryaustin
05/02/2022, 8:47 PMmonsto
05/02/2022, 8:47 PM; ({ data, error, count } = await supabase
.from('electronic_purchase_report')
.select('*', { count: 'exact' })
.gte('created_at', dateFrom.toISOString())
.lte('created_at', dateTo.toISOString())
.range(from, to)
.then(e => e)
.catch(error => console.log(`conlog: supabase catch`, error))
)
monsto
05/02/2022, 8:47 PMgaryaustin
05/02/2022, 8:48 PMmonsto
05/02/2022, 8:48 PMmonsto
05/02/2022, 8:49 PMgaryaustin
05/02/2022, 8:49 PMmonsto
05/02/2022, 8:49 PMgaryaustin
05/02/2022, 8:49 PM