-
Notifications
You must be signed in to change notification settings - Fork 116
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 'format' function to PostgresModule #184 #415
Add 'format' function to PostgresModule #184 #415
Conversation
@@ -227,6 +227,12 @@ trait PostgresModule extends Jdbc { self => | |||
FunctionDef[Timestampz, Timestampz](FunctionName("make_timestamptz")) | |||
val Encode = FunctionDef[(Chunk[Byte], String), String](FunctionName("encode")) | |||
val Decode = FunctionDef[(String, String), Chunk[Byte]](FunctionName("decode")) | |||
val Format0 = FunctionDef[String, String](FunctionName("format")) // TODO: varargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
varargs not available yet (see also 'concat' function)
Is there an open issue for varargs support? otherwise I would open an issue to track this (and might give it a try)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue here #439
testM("format4") { | ||
import Expr._ | ||
|
||
val query = select(Format4("Person: %s %s with null-literal %L and non-null-literal %L ", Customers.fName, Customers.lName, "FIXME: NULL", "literal")) from customers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't find a solution to specify NULL
tried Option.empty[String]
and null.asInstanceOf[String]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Options are not well supported at this point.
Thanks for this @TobiasPfeifer ! |
…-function Add 'format' function to PostgresModule zio#184
implements format function in ProstgresModule #184