Mihai Andrei
01/03/2023, 4:41 PMchinds
01/03/2023, 6:02 PMchris
would search for a first or last name that contains chris
i.e ['chris', 'christine', 'christopher'] etc but also search the email column returning i.e. with an email of foo@chris.com
I am seen some chatter of using postgres functions for doing this but have never actually seen an example of it working.dont
01/03/2023, 6:24 PMcreate trigger on_auth_user_created
after insert on auth.users
for each row execute procedure public.create_profile_for_new_user();
for creating a profile row when a user is created. The above snippet is copied from the migration after creating it via the supabase studio thing.
This trigger does not appear when resetting my db or deploying to staging. How should i get this trigger automatically in my different environments?neil
01/03/2023, 6:32 PMpatrick
01/03/2023, 7:34 PMBLOCKED
for our auth calls, and thus not handling our use case wellreno
01/03/2023, 9:42 PMpublic
?
There doesn't seem to be way to change the schema.
I know I can create them with PSQL statements, but it would be handy to have them viewable and editable in the UI.emre_
01/03/2023, 10:09 PMBearer ${access_token}
,
},
},
};
return createClient(SUPABASE_URL, SUPABASE_ANON_KEY, options);
}
};`
This code is returns errors like:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getUser')
Axel
01/04/2023, 4:12 AMxbrgrzbpugippzsbortq
Deng
01/04/2023, 5:18 AMMaomao
01/04/2023, 7:10 AMdelete_category: async (event) => {
const { supabaseClient } = await getSupabase(event)
const formData = await event.request.formData()
const categoryId = formData.get('id')
const { error } = await supabaseClient
.from('case_category')
.delete()
.eq('id', categoryId)
if (error) {
return invalid(500, {
error: 'Server error. Try again later'
})
}
return {
success: true
}
},
+page.svelte
const deleteCategory = async (categoryId) => {
deleteCategoryLoading = true
const data = new FormData()
data.append('id', categoryId)
const response = await fetch('/call-centre/settings?/delete_category', {
method: 'post',
body: data
})
const result = await response.json()
deleteCategoryLoading = false
if (result.type === 'invalid') {
displayAlert(result.data?.error, 'error')
} else {
await invalidate('supabase:auth')
await applyAction(result)
}
}
<button on:click={() => deleteCategory(category.id)}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-success hover:text-success-content rounded-full w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
</svg>
</button>
ŁukaszW.
01/04/2023, 10:44 AMhostname resolving error
lookup supabase_db_xxx no such hostKennStack01
01/04/2023, 10:47 AM!Daniel
01/04/2023, 10:54 AM𝖘𝖚𝖗𝖌𝖎𝖊𝖇𝖔𝖎 | Drooler
01/04/2023, 11:25 AMKennStack01
01/04/2023, 12:47 PMJulian Derungs
01/04/2023, 12:59 PMpg_crdt
combined with y.js
in the frontend. As y.js
uses providers to sync data back to a server (e.g. y-websocket
) I'm not sure how to make this work. Do I need to write a custom provider or am I able to just point to the supabase instance when using y-websocket
to persist my ydoc? I am using tiptap
editor in the frontend. Any hint appreciated 🙂Jodrigabber
01/04/2023, 1:05 PMrjdavis
01/04/2023, 2:07 PMFabrizio
01/04/2023, 2:32 PMKaran
01/04/2023, 2:43 PMdont
01/04/2023, 3:17 PMbegin
with team_insert as (
insert into public.teams(name, created_by)
values(new.first_name, new.user_id)
RETURNING id
)
insert into public.team_members (team_id, user_id)
values((select id from team_insert), new.user_id);
end;
robkuz
01/04/2023, 3:45 PMCREATE TYPE gender AS ENUM ('M', 'F', 'D');
nnet3
01/04/2023, 4:41 PMnnet3
01/04/2023, 4:48 PMŁukaszW.
01/04/2023, 5:44 PM20221114143410_remove_parent_foreign_key_refresh_tokens.up.sql, sql: alter table only auth.refresh_tokens\n drop constraint refresh_tokens_parent_fkey;\n: ERROR: constraint \"refresh_tokens_parent_fkey\" of relation \"refresh_tokens\" does not exist (SQLSTATE 42704)","time":"2023-01-04T17:31:18Z"}
Has some errors in my case on the latest version of CLI , so the auth container is not startingorganicnz
01/04/2023, 5:47 PMMatheus (M1)
01/04/2023, 6:21 PMemre_
01/04/2023, 7:37 PMmiky2fois
01/04/2023, 7:50 PMfood
- id
- name
food_meal_type (FK table)
- id
- mealTypeId
- foodId
meal_type
- id
- name
- value
- enabled
in SQL I would do something similar to:
select * from food
inner join food_meal_type on food.id = food_meal_type."foodId"
inner join meal_type on food_meal_type."mealTypeId" = meal_type.id;
I tried multiple ways including the below, but I haven't found a way to achieve it
const { data, error } = await supabase
.from("food")
.select(
`
id,
name,
mealTypes: food_meal_type(
*,
meal_type!mealTypeId(*)
)
`
)
The ideal result would be:
{
"id": "99fc8f86-36f3-4146-b8f2-78f0f8797f95",
"name": "Pesto fish fingers with broccoli mash",
"mealTypes": [
{
"id": "a27b61c0-0367-418a-bd85-6c0b0640b89e",
"mealTypeId": 4,
"foodId": "99fc8f86-36f3-4146-b8f2-78f0f8797f95",
// the fields below come from the meal_type table
"name": "lunch",
"value": "LUNCH"
}
]
}
How can I do the same using the supabase-js syntax?
Thank you.