queryb
Types
pub type CaseSensitivity {
CaseSensitive
CaseInsensitive
}
Constructors
-
CaseSensitive
-
CaseInsensitive
pub type Condition {
Equal(left: QueryValue, right: QueryValue)
StringContains(
string: QueryValue,
substring: QueryValue,
sensitivity: CaseSensitivity,
)
Or(List(Condition))
}
Constructors
-
Equal(left: QueryValue, right: QueryValue)
-
StringContains( string: QueryValue, substring: QueryValue, sensitivity: CaseSensitivity, )
-
Or(List(Condition))
pub type Query {
Select(
from: String,
columns: List(#(Option(String), String)),
order_by: #(String, Direction),
limit: Int,
offset: Int,
where: List(Condition),
)
Update(
table: String,
set: List(#(String, QueryValue)),
where: List(Condition),
)
Delete(from: String, where: List(Condition))
}
Constructors
-
Select( from: String, columns: List(#(Option(String), String)), order_by: #(String, Direction), limit: Int, offset: Int, where: List(Condition), )
-
Update( table: String, set: List(#(String, QueryValue)), where: List(Condition), )
-
Delete(from: String, where: List(Condition))
pub type QueryError {
ConstraintViolation(name: String, detail: String)
DatabaseError(detail: String)
}
Constructors
-
ConstraintViolation(name: String, detail: String)
-
DatabaseError(detail: String)
pub type QueryValue {
RelationValue(table: Option(String), column: String)
Parameter(number: Int)
}
Constructors
-
RelationValue(table: Option(String), column: String)
-
Parameter(number: Int)
Functions
pub fn to_postgresql(query: Query) -> String