julianDay function

This commit is contained in:
Gwendal Roué committed 2020-06-05 12:14:34 +02:00
1 parent 9aeccce227
commit 2aeddda77d
1 file changed
+18 -1
+18 -1
View File
@@ -144,7 +144,7 @@ public func sum(_ value: SQLSpecificExpressible) -> SQLExpression {
}
// MARK: - Swift String functions
// MARK: - String functions
/// :nodoc:
extension SQLSpecificExpressible {
@@ -214,3 +214,20 @@ extension SQLSpecificExpressible {
DatabaseFunction.localizedUppercase(sqlExpression)
}
}
// MARK: - Date functions
// MARK: JULIANDAY(...)
extension SQLFunctionName {
/// The `JULIANDAY` function name
public static let julianDay = SQLFunctionName("JULIANDAY")
}
/// Returns an expression that evaluates the `JULIANDAY` SQL function.
///
/// // JULIANDAY(date)
/// julianDay(Column("date"))
public func julianDay(_ value: SQLSpecificExpressible) -> SQLExpression {
SQLExpressionFunction(.julianDay, arguments: value)
}