Poo

Open
#30,877 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
1/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
postgresql, sql, typescript
Domain
databases

Research direction

The issue provides SQL snippets for updating and deleting rows in auth.users and adding public.kv to a realtime publication, but gives no problem description or expected behavior. Start by identifying whether this SQL belongs to Prisma ORM and what failure it is meant to address; completion criteria are not stated.

Written by the indexing model from the issue text.

Description

kind/feature
What problem are you trying to solve?

set search_path=public,extensions,auth as $$ begin if not public.is_teacher() then raise exception 'not allowed'; end if; if length(p_pw)<6 then raise exception 'password too short'; end if; update auth.users set encrypted_password=extensions.crypt(p_pw,extensions.gen_salt('bf')),updated_at=now() where email=lower(p_code)||'@qirio.app' and id not in (select uid from public.teachers); end $$; create or replace function public.admin_delete_user(p_code text) returns void language plpgsql security definer set search_path=public,auth as $$ begin if not public.is_teacher() then raise exception 'not allowed'; end if; delete from auth.users where email=lower(p_code)||'@qirio.app' and id not in (select uid from public.teachers); end $$; do $$ begin alter publication supabase_realtime add table public.kv; exception when duplicate_object then null; end $$; </script>

Proposed solution

set search_path=public,extensions,auth as $$ begin if not public.is_teacher() then raise exception 'not allowed'; end if; if length(p_pw)<6 then raise exception 'password too short'; end if; update auth.users set encrypted_password=extensions.crypt(p_pw,extensions.gen_salt('bf')),updated_at=now() where email=lower(p_code)||'@qirio.app' and id not in (select uid from public.teachers); end $$; create or replace function public.admin_delete_user(p_code text) returns void language plpgsql security definer set search_path=public,auth as $$ begin if not public.is_teacher() then raise exception 'not allowed'; end if; delete from auth.users where email=lower(p_code)||'@qirio.app' and id not in (select uid from public.teachers); end $$; do $$ begin alter publication supabase_realtime add table public.kv; exception when duplicate_object then null; end $$; </script>

Alternatives considered

No response

Scope and impact

No response

Dominant language
TypeScript
Stars
47.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
227

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prisma/orm

All issues in prisma/orm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.