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 support for var-arg db functions #439

Open
jczuchnowski opened this issue Apr 26, 2021 · 1 comment
Open

Add support for var-arg db functions #439

jczuchnowski opened this issue Apr 26, 2021 · 1 comment

Comments

@jczuchnowski
Copy link
Member

Add support for var-arg db functions like format or concat.

@jgoday
Copy link
Contributor

jgoday commented May 4, 2021

@jczuchnowski can this implementation be a valid solution? (https://github.com/jgoday/zio-sql/tree/feature_variadic_args)

It would allow to call custom procedure/function with N different typed args.

val customFn = variadicFunc[String]("concat_ws")
val query    = select(customFn(", ", fName, lName)) from customers

A pending improvement could be to allow define variadicFunc with argument type parameters

val customFn = variadicFunc[String, Int, String]("custom_function")
val query    = select(customFn(name, id)) from table

but I can only imagine implementing this with macros ...

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

No branches or pull requests

2 participants