fix(postgres): Fix sqlx's misinterpretation of Ids, update sqlx (#46)

This commit is contained in:
Aeledfyr
2020-07-30 22:45:22 -05:00
committed by GitHub
parent ff28ea8fa8
commit c05ae6e94c
9 changed files with 539 additions and 135 deletions

View File

@@ -18,13 +18,13 @@ impl TeamBuilder {
let team = Team { id: team_id };
sqlx::query(
sqlx::query!(
"
INSERT INTO teams (id)
VALUES ($1)
",
team.id as TeamId,
)
.bind(team.id)
.execute(&mut *transaction)
.await?;
@@ -38,17 +38,17 @@ impl TeamBuilder {
role: member.role,
};
sqlx::query(
sqlx::query!(
"
INSERT INTO team_members (id, team_id, user_id, name, role)
VALUES ($1, $2)
INSERT INTO team_members (id, team_id, user_id, member_name, role)
VALUES ($1, $2, $3, $4, $5)
",
team_member.id as TeamMemberId,
team_member.team_id as TeamId,
team_member.user_id as UserId,
team_member.name,
team_member.role,
)
.bind(team_member.id)
.bind(team_member.team_id)
.bind(team_member.user_id)
.bind(team_member.name)
.bind(team_member.role)
.execute(&mut *transaction)
.await?;
}