Richard E
Richard E
Explore posts from servers
DTDrizzle Team
Created by Richard E on 3/28/2024 in #help
How can I convert a null value to integer in a select?
I just got it .. keep forgetting postgres does some things I'm not used to:
ranking: sql<number>`coalesce(${player.ranking},9999)
ranking: sql<number>`coalesce(${player.ranking},9999)
`
4 replies
DTDrizzle Team
Created by Richard E on 3/28/2024 in #help
How can I convert a null value to integer in a select?
I have also tried the following:
ranking: player.ranking??9999
ranking: player.ranking??9999
4 replies
NNuxt
Created by EliteEngineer on 3/22/2024 in #❓・help
Help finding good guides
Also you could take a look at sidebase/nuxt-auth which uses authjs also https://github.com/sidebase/nuxt-auth
4 replies
NNuxt
Created by EliteEngineer on 3/22/2024 in #❓・help
Help finding good guides
Although I use supabase for auth right now, I came across this project while doing some research and it uses Auth.js. Also using some other tech I'm currently using such as Nuxt, Turborepo, drizzle and TRPC which was a nice find. https://github.com/romhml/k2
4 replies
DTDrizzle Team
Created by Tobias on 3/6/2024 in #help
drizzle-kit push:pg and sql commands
What I used to do was just tack it onto the end of the last schema change file generated. I don't think there is a way to create an empty migration file for yourself and have it added into the list of migration although that would be nice. I'm using supabase which has it's own migrations story so I've switched away from drizzle migrations totally now
2 replies
DTDrizzle Team
Created by Need_Not on 3/7/2024 in #help
onConflict or upsert?
Something like this I think:
await db.insert(your_table)
.values({ email: '[email protected]', name: 'Dan' })
.onConflictDoUpdate({ target: your_table.email, set: { name: 'John' } });
await db.insert(your_table)
.values({ email: '[email protected]', name: 'Dan' })
.onConflictDoUpdate({ target: your_table.email, set: { name: 'John' } });
5 replies
DTDrizzle Team
Created by Need_Not on 3/7/2024 in #help
onConflict or upsert?
5 replies
NNuxt
Created by Richard E on 1/15/2024 in #❓・help
Getting 404 after app.config.ts change
So it looks like this call in the top of the page fails while it's rebuilding and the error is from the server. The check and throw after doesn't even get called as the messages are different.
const { data: page } = await useAsyncData('index', () => queryContent('/').findOne())
if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
const { data: page } = await useAsyncData('index', () => queryContent('/').findOne())
if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
4 replies
DTDrizzle Team
Created by Richard E on 1/10/2024 in #help
Is there a way to introspect with specific order?
Thanks. Would make my git commit much nicer .. such a jumble now
3 replies