user
11/30/2021, 3:41 AMletourpowerscombine
11/30/2021, 8:02 AMusers
can subscribe to pages
and submit comments
on pages
. I have a users
table, a pages
table, a users_pages
table, and a comments
table.
I can currently pull a requested page
, along with the users
subscribed to it, with the following function. Is there anyway I can edit this the function below to pull all of the comments
for the requested page as well? Each comment
has a foreign key corresponding to page_id
.
javascript
const { data, error } = await supabase
.from('pages')
.select(`*, users(id, email)`)
.eq('slug', request.body.get('slug'))
@User recommended doing it like this:
javascript
const { data, error } = await supabase
.from('pages')
.select(`*, users(id, email), comments(*)`)
.eq('slug', request.body.get('slug'))
— which results in this error:
javascript
{
message: 'More than one relationship was found for pages and users',
hint: "By following the 'details' key, disambiguate the request by changing the url to /origin?select=relationship(*) or /origin?select=target!relationship(*)",
details: [
{
relationship: 'public.users_pages[users_pages_page_id_fkey][users_pages_user_id_fkey]',
cardinality: 'm2m',
origin: 'public.pages',
target: 'public.users'
},
{
relationship: 'public.comments[comments_page_id_fkey][artifacts_user_id_fkey]',
cardinality: 'm2m',
origin: 'public.pages',
target: 'public.users'
}
]
}
Can anybody recommend a way to troubleshoot this? Do I need to set up any other tables in my database, like a comments_pages
table, or change the way I'm doing foreign keys?carlomigueldy.eth
11/30/2021, 9:44 AMjumpship
11/30/2021, 10:20 AM.select()
. I want to fetch all except one (email).jumpship
11/30/2021, 10:21 AM.select(*).except('email')
Or do I need to explicitly fetch the 11 things?HarryET
11/30/2021, 11:40 AMjumpship
11/30/2021, 1:01 PMjumpship
11/30/2021, 1:01 PMjumpship
11/30/2021, 1:01 PMjumpship
11/30/2021, 1:02 PMjumpship
11/30/2021, 1:43 PMHarryET
11/30/2021, 1:44 PMsilentworks
11/30/2021, 3:04 PMJustTheSyme
11/30/2021, 9:32 PM"could not extend file \"base/12662/16813\": No space left on this device
when trying to insert to my database. I'm on using a 1/3 of the database's alloted space. What might be going on here?david-thyresson
11/30/2021, 11:14 PMJaaneek
12/01/2021, 12:05 AMTiger Abrodi 🐆
12/01/2021, 7:57 AMTiger Abrodi 🐆
12/01/2021, 7:57 AMTiger Abrodi 🐆
12/01/2021, 7:58 AMTiger Abrodi 🐆
12/01/2021, 7:58 AMTiger Abrodi 🐆
12/01/2021, 7:58 AMTiger Abrodi 🐆
12/01/2021, 7:59 AMTiger Abrodi 🐆
12/01/2021, 7:59 AMalpha_
12/01/2021, 10:47 AMHarryET
12/01/2021, 11:24 AMassistattow
12/01/2021, 11:24 AMHarryET
12/01/2021, 11:25 AMassistattow
12/01/2021, 11:25 AMassistattow
12/01/2021, 11:25 AMalpha_
12/01/2021, 11:25 AM