garyaustin
05/07/2022, 3:25 PMgaryaustin
05/07/2022, 8:01 PMjon.m
05/07/2022, 10:09 PMjon.m
05/07/2022, 11:10 PMjon.m
05/07/2022, 11:11 PMash
05/07/2022, 11:11 PMSTILLWATER;
05/09/2022, 9:32 AMsql
const { data, error } = await supabase_connect
.from('Users')
.select('id,image_url,name,username,age')
// .eq('country', country)
.eq('gender', gender)
.gte('age', age_ll)
.lte('age', age_ul)
// .offset(skip)
.limit(limit);
and i cant use offset (wrong syntax prolly) and i cant find it on website, any helpSTILLWATER;
05/09/2022, 9:33 AMSTILLWATER;
05/09/2022, 9:33 AMtourdownunder
05/09/2022, 10:59 AMLudvig
05/09/2022, 12:16 PMsql
CREATE FUNCTION test_function(products_object_array_input some_data_type) -- what should the data type be? array? jsonb[]?
An array of objects that I would pass into the function could look like this:
json
[
{ "productID": 3, "quantity": 5 },
{ "productID": 1, "quantity": 2 }
]
First question: What should I set the products_object_array_input data type as? array? jsonb[]?
Second question: I then want to loop over the array to insert the values of the object array. Again, using plpgsql. How?
sql
-- I want to loop over cart_array_input and do this for every object in the array. Sorry for pseudo-code. i = iterator
insert into order_item(product_id, quantity)
values(products_object_array_input[i].productID, products_object_array_input[i].quantity);
Scott P
05/09/2022, 7:56 PMedgaras
05/09/2022, 9:04 PMedgaras
05/09/2022, 9:04 PMitems references items
?edgaras
05/09/2022, 9:10 PMjaitaiwan
05/09/2022, 11:01 PMleviwhalen
05/12/2022, 11:11 AMpages
table but I'm not sure if I should create a components
table with rows that have foreign keys from the pages
table -- or use a components
field set as an array type.
I am concerned about the large number of rows modified as a user creates and modifies a page, and the high cardinality of this relationship.burggraf
05/12/2022, 1:04 PMSTILLWATER;
05/13/2022, 11:00 AMLars
05/14/2022, 12:59 PMsql
CREATE OR REPLACE FUNCTION public.updateoffset(site text, offsetnumber integer, toscrape integer)
RETURNS void
LANGUAGE sql
AS $function$
update settings set "offset" = coalesce("offset", '{}') || '{"$2": {"toscrape":$3}}'
where site = $1;
$function$
calling it via: sql
SELECT * FROM public.updateoffset('test', 2, 2)
burggraf
05/14/2022, 2:01 PMceleronCoder
05/14/2022, 2:24 PMsql
select storage.foldername('invoices/Test-Patient/2322_22-05-2021.pdf') from storage.objects;
I expect one result with folders as ["invoices", "Test-Patient"]
but I am getting two duplicate entries.
I only have one file in the whole bucket and when I added one more I got three duplicate entries.kingwill101
05/14/2022, 8:52 PMgaryaustin
05/14/2022, 9:01 PMmrboutte
05/15/2022, 5:07 PMpayment_method
table with the following SQL
sql
SELECT
EXISTS(
SELECT
*
FROM
payment_method
INNER JOIN account ON account.id = payment_method.account
WHERE
account.account_owner = auth.uid()
);
☝️ this works fine in the sequel editor, but when I try to create a policy with it — I get back Error adding policy: syntax error at or near "SELECT"
Azura
05/16/2022, 6:51 AMsylar815
05/16/2022, 5:14 PMburggraf
05/16/2022, 5:32 PMjaitaiwan
05/17/2022, 1:46 AMgaryaustin
05/17/2022, 4:00 AM