mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
julianDay function
This commit is contained in:
1 parent
9aeccce227
commit
2aeddda77d
1 file changed
+18
-1
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user