vapor
vapor
Explore posts from servers
DTDrizzle Team
Created by vapor on 8/29/2023 in #help
Having statement to compare sql<number> and number
thx bud
4 replies
DTDrizzle Team
Created by vapor on 8/29/2023 in #help
Having statement to compare sql<number> and number
it seems like this is maybe a better approach?:
const query = db
.select({
workerUid: workerStatsDaily.workerUid,
activeInterval: sql<number>`sum(${workerStatsDaily.activeInterval})`,
})
.from(workerStatsDaily)
.where(between(workerStatsDaily.day, input.startDate, input.endDate))
.groupBy(workerStatsDaily.workerUid)
.as("query")

const totalCount = await db
.select({ count: sql<number>`count(*)` })
.from(query)
.where(gt(query.activeInterval, 3600))
const query = db
.select({
workerUid: workerStatsDaily.workerUid,
activeInterval: sql<number>`sum(${workerStatsDaily.activeInterval})`,
})
.from(workerStatsDaily)
.where(between(workerStatsDaily.day, input.startDate, input.endDate))
.groupBy(workerStatsDaily.workerUid)
.as("query")

const totalCount = await db
.select({ count: sql<number>`count(*)` })
.from(query)
.where(gt(query.activeInterval, 3600))
4 replies
DTDrizzle Team
Created by vapor on 6/27/2023 in #help
Invalid input for drizzle-kit pg:inspect
upgrading to latest drizzle-kit and drizzle-orm fixed this!
4 replies
TtRPC
Created by vapor on 6/8/2023 in #❓-help
Middleware-ish for client
Awesome thanks !
5 replies
DTDrizzle Team
Created by vapor on 6/7/2023 in #help
Tx Rollback meesage
Thanks !
3 replies
DTDrizzle Team
Created by vapor on 5/24/2023 in #help
Option filter parameters
great thanks, looks good
11 replies