Skip to content

Commit

Permalink
perf(user): exact column user query (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Jul 18, 2024
1 parent fe2400d commit a8b5f23
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/~/users/repository/src/get_user_by_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ export async function get_user_by_id(
{ id }: { id: number },
) {
return pg.query.users.findFirst({
columns: {
created_at: true,
email_verified: true,
email: true,
family_name: true,
given_name: true,
id: true,
job: true,
last_sign_in_at: true,
phone_number: true,
reset_password_sent_at: true,
sign_in_count: true,
updated_at: true,
verify_email_sent_at: true,
},
where: eq(schema.users.id, id),
});
}
Expand Down

0 comments on commit a8b5f23

Please sign in to comment.