logs method
Future<void>
logs(
- DatabaseSession session,
- SessionLogEntry sessionLogEntry,
- List<
LogEntry> logEntry, { - Transaction? transaction,
Creates a relation between this SessionLogEntry and the given LogEntrys
by setting each LogEntry's foreign key sessionLogId to refer to this SessionLogEntry.
Implementation
Future<void> logs(
_i1.DatabaseSession session,
SessionLogEntry sessionLogEntry,
List<_i2.LogEntry> logEntry, {
_i1.Transaction? transaction,
}) async {
if (logEntry.any((e) => e.id == null)) {
throw ArgumentError.notNull('logEntry.id');
}
if (sessionLogEntry.id == null) {
throw ArgumentError.notNull('sessionLogEntry.id');
}
var $logEntry = logEntry
.map((e) => e.copyWith(sessionLogId: sessionLogEntry.id))
.toList();
await session.db.update<_i2.LogEntry>(
$logEntry,
columns: [_i2.LogEntry.t.sessionLogId],
transaction: transaction,
);
}