Skip to content

Instantly share code, notes, and snippets.

@scaryghost
Last active January 1, 2016 13:59
Show Gist options
  • Save scaryghost/8154369 to your computer and use it in GitHub Desktop.
Save scaryghost/8154369 to your computer and use it in GitHub Desktop.
sql query builder examples
QueryBuilder() {
and() {
eq(col, val)
lt(col, val)
}
}
///< (c1 = v1 || c2 < v2
QueryBuilder() {
or() {
eq(c1, v1)
lt(c2, v2)
}
}
///< (c1 == v1 || c2 == v2) && c3 <= v3
QueryBuilder() {
and() {
or() {
eq(c1, v1)
eq(c2, v2)
}
gte(c3, v3)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment