currentDateAndTime top-level constant

Expression<DateTime> const currentDateAndTime

A sql expression that evaluates to the current date and time, similar to DateTime.now. Timestamps are stored with a second accuracy.

Implementation

const Expression<DateTime> currentDateAndTime = _DependingOnDateTimeExpression(
  forIsoString: _currentTimestampLiteral,
  forTimestamps: _CastInSqlExpression(
    FunctionCallExpression(
      'strftime',
      [Constant('%s'), _currentTimestampLiteral],
    ),
    DriftSqlType.dateTime,
  ),
);