zio-jdbc icon indicating copy to clipboard operation
zio-jdbc copied to clipboard

additional features for Sql[+A]

Open yisraelU opened this issue 3 years ago • 3 comments

potentials

  • in
  • notIn
  • and
  • or
  • where

yisraelU avatar Feb 09 '22 21:02 yisraelU

These methods can be added to Sql type and modelled after the existing Sql#values method.

Example:

class Sql[+A](...) { self =>
  def and(right: Sql[ZResultSet])(implicit ev: A <:< ZResultSet): Sql[ZResultSet] = 
    self ++ Sql(" AND ", identity(_)) ++ right
}

For improved performance, we can construct the syntax fragments as constant values which are private and stored in the Sql companion object, together with other existing constants such as values.

jdegoes avatar Feb 14 '22 16:02 jdegoes

@jdegoes, I would like to work on this.

zagyi avatar Feb 14 '22 23:02 zagyi

#21 contains 'and' plus 'or' methods

yisraelU avatar Feb 16 '22 20:02 yisraelU