authUser method
Future<void>
authUser(
- DatabaseSession session,
- GitHubAccount gitHubAccount,
- AuthUser authUser, {
- 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,
);
}