Skip to content

Commit

Permalink
fix: batch いらない
Browse files Browse the repository at this point in the history
  • Loading branch information
a01sa01to committed Jan 7, 2025
1 parent 764415d commit 1b324bb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions webapp/repository/idp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ export class IdpRepository {

async createUserWithOauth(user: IUserInfo): Promise<boolean> {
// Cloudflare D1 での transaction はサポートされてないっぽいので Batch する (ググるといろいろ出てくる)
const res = await this.db.batch([
this.insertStmt.user.bind(
user.id,
user.display_name,
user.profile_image_url,
),
])
return res.every(r => r.success)
const res = await this.insertStmt.user
.bind(user.id, user.display_name, user.profile_image_url)
.run()
return res.success
}
}

0 comments on commit 1b324bb

Please sign in to comment.