postgres-language-server icon indicating copy to clipboard operation
postgres-language-server copied to clipboard

fix: sql fn params

Open psteinroe opened this issue 8 months ago • 0 comments

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

psteinroe avatar Apr 22 '25 08:04 psteinroe