Varna
Varna
Explore posts from servers
DTDrizzle Team
Created by Varna on 7/23/2024 in #help
Counting many-to-many items
I ended up doing this:
const items = await db
.select({
...getTableColumns(A),
B: count(AB.B),
C: count(AC.C)
})
.from(A)
.orderBy(A.name)
.leftJoin(AB, eq(AB.A, A.id))
.leftJoin(AC, eq(AC.A, C.id))
.groupBy(A.id)
const items = await db
.select({
...getTableColumns(A),
B: count(AB.B),
C: count(AC.C)
})
.from(A)
.orderBy(A.name)
.leftJoin(AB, eq(AB.A, A.id))
.leftJoin(AC, eq(AC.A, C.id))
.groupBy(A.id)
4 replies
DTDrizzle Team
Created by Varna on 7/23/2024 in #help
Counting many-to-many items
I'm migrating from this Prisma query:
return prisma.A.findMany({
include: {
_count: {
select: {
B: true,
C: true
}
}
}
})
return prisma.A.findMany({
include: {
_count: {
select: {
B: true,
C: true
}
}
}
})
4 replies
CDCloudflare Developers
Created by Varna on 5/22/2024 in #workers-help
I'm looking for a way to replicate worker wrangler.toml/routes in local dev mode
I don't remember If I had used any additional properties. atm in countryside
7 replies
CDCloudflare Developers
Created by Varna on 5/22/2024 in #workers-help
I'm looking for a way to replicate worker wrangler.toml/routes in local dev mode
export default defineConfig({
server: {
proxy: {
'/api': {
// if api worker running on localhost:4321
target: 'http://localhost:4321/api',
changeOrigin: true
},
},
},
})
export default defineConfig({
server: {
proxy: {
'/api': {
// if api worker running on localhost:4321
target: 'http://localhost:4321/api',
changeOrigin: true
},
},
},
})
7 replies
CDCloudflare Developers
Created by Varna on 5/22/2024 in #workers-help
I'm looking for a way to replicate worker wrangler.toml/routes in local dev mode
7 replies
CDCloudflare Developers
Created by Varna on 5/22/2024 in #workers-help
I'm looking for a way to replicate worker wrangler.toml/routes in local dev mode
Sorry for late reply @knoblauchbrot I did not, but I'm using Vite, so I set up Vite proxy instead. The setup is this: On Production, the normal flow is that my server .use() client bundle to serve client app on same worker. On Development, my front-end (Vite) server uses proxy feature, to serve /api routes on same domain (localhost).
7 replies
CDCloudflare Developers
Created by Varna on 5/27/2024 in #workers-help
I renamed my Worker in Dash and wrangler.toml, but became unauthorized in wrangler and can't deploy
It seems that our Workers Paid was cut to Free because boss failed his card payment. This why logpush started failing.
3 replies
CDCloudflare Developers
Created by Varna on 5/27/2024 in #workers-help
I renamed my Worker in Dash and wrangler.toml, but became unauthorized in wrangler and can't deploy
https://github.com/cloudflare/workers-sdk/issues/2991 Removing logpush = true from wrangler.toml fixed it.
3 replies
CDCloudflare Developers
Created by bun on 5/1/2024 in #next-on-pages
nope that works perfectly
I'm probably giving up on using Next with Pages. My VPS deployments feel more stable.
43 replies
CDCloudflare Developers
Created by bun on 5/1/2024 in #next-on-pages
nope that works perfectly
So the action didn't run at all, it was either not compiled, or had different url than client expected.
43 replies
CDCloudflare Developers
Created by bun on 5/1/2024 in #next-on-pages
nope that works perfectly
If you log N times in same action. It ends up as an array of messages on single request. But in this case. It was empty for me.
43 replies
CDCloudflare Developers
Created by bun on 5/1/2024 in #next-on-pages
nope that works perfectly
but it's pretty strange.
43 replies