refactoring: move sql files
This commit is contained in:
12
resources/sql/functions/user/find_user_by_username.sql
Normal file
12
resources/sql/functions/user/find_user_by_username.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
create or replace function find_user_by_username(in username text, out resource json) language plpgsql as
|
||||
$$
|
||||
declare
|
||||
_username alias for username;
|
||||
begin
|
||||
select to_jsonb(u) - 'password' into resource
|
||||
from "user" as u
|
||||
where u.username = _username;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_user_by_username(text, out json);
|
||||
Reference in New Issue
Block a user