Closed kevinji closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
auth-docs | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Apr 26, 2024 8:23am |
Closing due to lack of attention from reviewers and also that I've switched to using https://github.com/lucia-auth/lucia instead.
โ๏ธ Reasoning
userId
to theid
inusers
with cascading delete. The delete user query can now be a single one due to cascading deletes.id
insessions
is deleted and the primary key replaced withsessionToken
, which needs to be unique anyways. Turning it into the primary key should also speed upWHERE sessionToken
queries.SELECT
thenUPDATE
are now a singleUPDATE
to ensure atomicity. This required creating a rather uglycreateParameterizedUpdate
function to only join togetherkey = $2
if it exists in the passed-in object. I was unable to figure out the right incantation of TypeScript types to makecreateParameterizedUpdate
type-safe but happy to accept any suggestions to fix this.๐งข Checklist
๐ซ Affected issues
๐ Resources