postgres-language-server
postgres-language-server copied to clipboard
fix: sql fn params
the idea is to replace the fn params with a default value based on their type:
create or replace function users.select_no_ref (user_id int4) returns table (
first_name text
) language sql security invoker as $$
select
first_name
FROM
users_hidden.users
where
id = user_id;
$$;
will become
create or replace function users.select_no_ref (user_id int4) returns table (
first_name text
) language sql security invoker as $$
select
first_name
FROM
users_hidden.users
where
id = 0; -- <-- here
$$;
Todo
- [ ] pass params to typechecker
- [ ] implement
apply_identifiers
fixes #353 fixes #352