-
Notifications
You must be signed in to change notification settings - Fork 104
SQL functions: Auto suggestions for sql function input parameters as query operators/comparisions #433
-
Feature
I would love it if the PLS language server could suggest input parameters as operators in sql functions. The main usage would be where clauses.
Right now, the PLS detects the usage of incorrect named input parameters. That's why I believe it should be possible to suggest comparison operators in where clauses.
Example
create function test_auto_suggesstions_in_where_comparison(user_id uuid) returns users_hidden.users language sql as $$ select * from users_hidden.users u where u.id = user_id; $$;
Here I have a working sql function. I would like to find a user with a given user_id
handed in as input. I think it would be nice if the PLS could suggest the input after the =
as <space><input_parameter_name>
and if possible, indicate, the type in the dropdown menu, too (similar DX as in select).
Current behavior:
Prefered behaviour as for select:
Alternatives
Typing it yourself. Possible but worse DX experience.
Relevance
Low. More a quality-of-life improvement but probably not that hard to implement. What do you think @juleswritescode ?
Beta Was this translation helpful? Give feedback.