mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Improve transactionDate and transactionClock documentation
This commit is contained in:
1 parent
5ed44b94bc
commit
43ff278748
3 files changed
+5
-4
No files matched your search
@@ -174,7 +174,7 @@ public struct Configuration {
|
||||
/// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features)
|
||||
///
|
||||
/// The default clock is ``DefaultTransactionClock`` (which returns the
|
||||
/// current date with `Date()`).
|
||||
/// start date of the current transaction).
|
||||
///
|
||||
/// For example:
|
||||
///
|
||||
|
||||
@@ -312,8 +312,8 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
|
||||
///
|
||||
/// See <doc:RecordTimestamps> for an example of usage.
|
||||
///
|
||||
/// Transaction dates, by default, are built from a new `Date()` instance.
|
||||
/// You can override this default behavior by configuring
|
||||
/// The transaction date, by default, is the start date of the current
|
||||
/// transaction. You can override this default behavior by configuring
|
||||
/// ``Configuration/transactionClock``.
|
||||
public var transactionDate: Date {
|
||||
get throws {
|
||||
|
||||
@@ -41,8 +41,9 @@ extension TransactionClock where Self == CustomTransactionClock {
|
||||
}
|
||||
}
|
||||
|
||||
/// The default clock.
|
||||
/// The default transaction clock.
|
||||
public struct DefaultTransactionClock: TransactionClock {
|
||||
/// Returns the start date of the current transaction.
|
||||
public func now(_ db: Database) throws -> Date {
|
||||
// An opportunity to fetch transaction time from the database when
|
||||
// SQLite supports the feature.
|
||||
|
||||
Reference in new issue
Block a user