Effectuer des opérations admin sur la base Supabase self-hosted (query, insert, update, delete sur profiles, staff_members, etc.)
Skill pour effectuer des opérations admin sur la base de données Supabase self-hosted.
Les credentials sont stockés dans .env.supabase (fichier gitignored).
Avant chaque requête, charger les credentials:
export $(grep -v '^#' .env.supabase | xargs)
export $(grep -v '^#' .env.supabase | xargs) && curl -s "https://db.wefamily.ch/rest/v1/TABLE?FILTERS" \
-H "apikey: $SUPABASE_SERVICE_ROLE_KEY" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY"
export $(grep -v '^#' .env.supabase | xargs) && curl -s -X POST "https://db.wefamily.ch/rest/v1/TABLE" \
-H "apikey: $SUPABASE_SERVICE_ROLE_KEY" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{"column": "value"}'
export $(grep -v '^#' .env.supabase | xargs) && curl -s -X PATCH "https://db.wefamily.ch/rest/v1/TABLE?id=eq.UUID" \
-H "apikey: $SUPABASE_SERVICE_ROLE_KEY" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{"column": "new_value"}'
export $(grep -v '^#' .env.supabase | xargs) && curl -s -X DELETE "https://db.wefamily.ch/rest/v1/TABLE?id=eq.UUID" \
-H "apikey: $SUPABASE_SERVICE_ROLE_KEY" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY"
export $(grep -v '^#' .env.supabase | xargs) && curl -s "https://db.wefamily.ch/auth/v1/admin/users" \
-H "apikey: $SUPABASE_SERVICE_ROLE_KEY" \
-H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY"
profiles - id, staff_account_id, display_namestaff_members - id, user_id, first_name, last_name, email, positionschedule_entries - Entrées de planningtasks - Tâches assignéestime_entries - Pointagesinvoices - Facturesclients - Clientseq. - égal: [email protected]neq. - différentis. - null: ?staff_account_id=is.nullin. - liste: ?id=in.(uuid1,uuid2)