queries method

Future<void> queries(
  1. DatabaseSession session,
  2. SessionLogEntry sessionLogEntry,
  3. List<QueryLogEntry> queryLogEntry, {
  4. Transaction? transaction,
})

Creates a relation between this SessionLogEntry and the given QueryLogEntrys by setting each QueryLogEntry's foreign key sessionLogId to refer to this SessionLogEntry.

Implementation

Future<void> queries(
  _i1.DatabaseSession session,
  SessionLogEntry sessionLogEntry,
  List<_i3.QueryLogEntry> queryLogEntry, {
  _i1.Transaction? transaction,
}) async {
  if (queryLogEntry.any((e) => e.id == null)) {
    throw ArgumentError.notNull('queryLogEntry.id');
  }
  if (sessionLogEntry.id == null) {
    throw ArgumentError.notNull('sessionLogEntry.id');
  }

  var $queryLogEntry = queryLogEntry
      .map((e) => e.copyWith(sessionLogId: sessionLogEntry.id))
      .toList();
  await session.db.update<_i3.QueryLogEntry>(
    $queryLogEntry,
    columns: [_i3.QueryLogEntry.t.sessionLogId],
    transaction: transaction,
  );
}