BinaryArtifex
BinaryArtifex
Explore posts from servers
NNuxt
Created by BinaryArtifex on 9/18/2024 in #❓・help
how does nuxt prevent parallel session refresh attempts on a nested route?
ahh right yeah so all external services are called via an in-house sdk. on login, i store the tokens somewhere. if im on products/ page, i call the products endpoint using the access token. i might have a few other components on the products page that call their respective services on page load. the issue comes with closing the browser, coming back later to that same page and the access token has expired. suddenly all services return a 401 and try to refresh the token in parallel. just looking at ways to somehow control the session management such that i avoid a cascade of refresh requests. hope i explained that better
3 replies
NNuxt
Created by BinaryArtifex on 9/18/2024 in #❓・help
how does nuxt prevent parallel session refresh attempts on a nested route?
yeah mate so ive got to use an in-house auth sdk. i get the access and refresh token on login, access tokens have a short life, 30 min i think. its easy enough to attempt a refresh on a 401, but im also managing 10+ services each using that shared access token. my issue now is if i have a service on each nested nuxt route and the token expires, ill endup making n-1 redundant calls. still waiting on remix to release their middleware feature, wondering if theres a nuxt equivilent?
3 replies
NNuxt
Created by luhu on 2/2/2024 in #❓・help
Storybook in Nuxt: Anyone got it running?
its now mid september. senior react dev. been throwin into a greenfields nuxt project, if its one thing i vehemently hate, its frameworks that hide away and manage deps on your behalf, so when problems happen, you gotta wait for someone else to pull the proverbial stick out, like NX, the monorepo manager for example, the amount of work hours ive lost trying to fix things i have no business having to fix in the first place. ive wasted my ENTIRE f*cking work day trying to get storybook going in nuxt....im ok.....
3 replies
DTDrizzle Team
Created by BinaryArtifex on 1/6/2024 in #help
how to add ulid compatibility to postgres?
now that i think about it, ive been downa bit of a rabbit hole about how best to store ulid's in a postgres database and without needlessly bloating primary keys (via varchar(26)) and still have the nicety of sortable indexing so i think im gonna drop the whole ulid thing in favor of uuidv7. there's currently a good npm lib at https://github.com/LiosK/uuidv7 that looks like a good candidate...
2 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman at the risk of stretchin the friendship i don't spose a cheeky little Check constraint feature is gonna creep into 0.29.0? cause that'd just be swell.
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
onConflictDoNothing does not exist on planetscale client
oh nice, forgot i even asked this and went back to ask again and found my original question answered haha
6 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
cant see a mention of custom names for primary keys in the releases page just yet, will this feature be far away?
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman been away for a minute sorry for late reply, yeah im pushing incremental migrations to planetscale through the greenfields phase till i settle on a version 1 database schema for production, so before that its the wild west atm
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
onConflictDoNothing does not exist on planetscale client
oh hang on....is this what im looking for? this doesn't appear to be in the docs....
export async function lookupNationalitySeed(client: DbClient) {
await client
.insert(lookupNationality)
.ignore() // <<------
.values(
data.map((nationality) => ({
id: ulid(),
name: nationality,
slug: paramCase(nationality),
})),
);
}
export async function lookupNationalitySeed(client: DbClient) {
await client
.insert(lookupNationality)
.ignore() // <<------
.values(
data.map((nationality) => ({
id: ulid(),
name: nationality,
slug: paramCase(nationality),
})),
);
}
6 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman sorry to buzz ya mate, don't seem to be getting a bite on my question, hopin you could maybe point me in the right direction? i don't particularly want to compress my table or column names as ive got a consistent set of conventions id really prefer to stick to....
13 replies