Created
December 28, 2017 21:05
-
-
Save Jacoby6000/08444ea35ea8ad662c133a7bb81933ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Path(path: String) extends AnyVal | |
trait QueryValue[U, A] { | |
def param(u: U): A | |
def function(path: Path, args: List[A]): A | |
def nul: A | |
} | |
trait QueryComparison[U, A] { | |
// Compositions with values | |
def equal(l: U, r: U): A | |
def greaterThan(l: U, r: U): A | |
def greaterThanOrEqual(l: U, r: U): A | |
def lessThanOrEqual(l: U, r: U): A | |
def in(value: U, compareTo: List[U]): A | |
def lit(u: U): A | |
// compositions with other comparisons | |
def not(a: A): A | |
def and(l: A, r: A): A | |
def or(l: A, r: A): A | |
} | |
trait QueryProjection[U, A] { | |
def all: A | |
def one(selection: U, alias: Option[String]): A | |
} | |
trait QueryJoin[T, U, A] { | |
def inner(table: U, condition: T): A | |
def fullOuter(table: U, condition: T): A | |
def leftOuter(table: U, condition: T): A | |
def rightOuter(table: U, condition: T): A | |
def cross(table: U, condition: T): A | |
} | |
trait QuerySort[A] { | |
def ascending(queryPath: Path): A | |
def descending(queryPath: Path): A | |
} | |
trait QueryExpression[T, U, V, W, X, A, B] { | |
def select(table: U, values: List[U], joins: List[T], filter: Option[V], sorts: List[W], groupings: List[W], offset: Option[Long], limit: Option[Long]): A | |
def insert(collection: Path, values: List[(Path, X)]): B | |
def update(collection: Path, values: List[(Path, X)], where: V): B | |
def delete(collection: Path, where: V): B | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment