Skip to content

Instantly share code, notes, and snippets.

@odenzo
Created November 29, 2016 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odenzo/95184db36378e85075db0145b78e95cf to your computer and use it in GitHub Desktop.
Save odenzo/95184db36378e85075db0145b78e95cf to your computer and use it in GitHub Desktop.
Quill 1.0.1-SNAPSHOT Postgres Operator adding
import io.getquill.context.sql.SqlContext
trait PostgresDsl { this: SqlContext[_, _] =>
/**
* @shortDescription A DSL extension to allow bitwise or operator on Int columns
* Tested with integer columns in postgres
*/
implicit class BitwiseOR(s1: Int) {
def bitwiseOR(s2: Int) = quote(infix"$s1 | $s2".as[Int])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment