authUser method

Future<void> authUser(
  1. DatabaseSession session,
  2. GitHubAccount gitHubAccount,
  3. AuthUser authUser, {
  4. Transaction? transaction,
})

Creates a relation between the given GitHubAccount and AuthUser by setting the GitHubAccount's foreign key authUserId to refer to the AuthUser.

Implementation

Future<void> authUser(
  _i1.DatabaseSession session,
  GitHubAccount gitHubAccount,
  _i2.AuthUser authUser, {
  _i1.Transaction? transaction,
}) async {
  if (gitHubAccount.id == null) {
    throw ArgumentError.notNull('gitHubAccount.id');
  }
  if (authUser.id == null) {
    throw ArgumentError.notNull('authUser.id');
  }

  var $gitHubAccount = gitHubAccount.copyWith(authUserId: authUser.id);
  await session.db.updateRow<GitHubAccount>(
    $gitHubAccount,
    columns: [GitHubAccount.t.authUserId],
    transaction: transaction,
  );
}