Improve transactionDate and transactionClock documentation

This commit is contained in:
Gwendal Roué committed 2023-02-23 08:34:09 +01:00
1 parent 5ed44b94bc
commit 43ff278748
3 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -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:
///
+2 -2
View File
@@ -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 {
+2 -1
View File
@@ -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.