Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modifier support for ARRAY types and other advanced stuff #141

Closed
hrach opened this issue Feb 28, 2021 · 3 comments · Fixed by #156
Closed

Add modifier support for ARRAY types and other advanced stuff #141

hrach opened this issue Feb 28, 2021 · 3 comments · Fixed by #156

Comments

@hrach
Copy link
Member

hrach commented Feb 28, 2021

I.e. support advanced expression in Postgres like

WHERE "roles"."privileges" ?| array ['*', 'app', 'app.client', 'app.client.entry']
@hrach
Copy link
Member Author

hrach commented Mar 8, 2021

I believe the best way is to support simple list modifier. Something like

query('WHERE [roles.privileges] ?| ARRAY[%modifier]', ['*', 'app', 'app.client', 'app.client.entry']);

The question is how to name the modifier. Currently we use [] suffix to validate array input and we put additional braces around the modifier - %s[] produces ('*', 'app', 'app.client', 'app.client.entry').

Possibilities:

  • %s{} other way of representaing a list.
  • %s![] wtf char to be different
  • %sL[] list array
  • ... other options?

cc @JanTvrdik

@hrach
Copy link
Member Author

hrach commented Mar 17, 2021

  • %s<>
  • %<s>
  • %list<s>

@hrach
Copy link
Member Author

hrach commented Mar 19, 2021

%column[] already works the way it does not add (). Also, [] currently means what type is expected, not what the output looks like. So maybe the better way is let [] be and try to add other variation for the expression.

Maybe we could use a spread - something like %...s[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant