Skip to content

Commit e7f4516

Browse files
committed
type fix
1 parent c662a31 commit e7f4516

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/db/scripts/seed-stress-test-users.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* cd packages/db && bun run scripts/seed-stress-test-users.ts
66
*/
77

8-
import { eq } from 'drizzle-orm'
8+
import { eq, type InferInsertModel } from 'drizzle-orm'
99
import { db, userTableDefinitions, userTableRows } from '../index'
1010

1111
const WORKSPACE_ID = '098d71e1-6a36-47e3-874d-818faee0bfe8'
@@ -124,7 +124,7 @@ async function main() {
124124
console.log(`Seeding ${TABLE_NAME} table for workspace ${WORKSPACE_ID}...`)
125125

126126
// Get user ID for created_by
127-
const userResult = await db.execute<{ id: string }[]>(`SELECT id FROM "user" LIMIT 1`)
127+
const userResult = (await db.execute(`SELECT id FROM "user" LIMIT 1`)) as { id: string }[]
128128
const userId = Array.isArray(userResult) && userResult[0] ? userResult[0].id : 'system'
129129
console.log(`Using user ID: ${userId}`)
130130

@@ -189,7 +189,7 @@ async function main() {
189189
console.log(`Inserting ${NUM_ROWS} rows in batches of ${batchSize}...`)
190190

191191
for (let i = 0; i < NUM_ROWS; i += batchSize) {
192-
const batch = []
192+
const batch: InferInsertModel<typeof userTableRows>[] = []
193193
const endIdx = Math.min(i + batchSize, NUM_ROWS)
194194

195195
for (let j = i; j < endIdx; j++) {

packages/db/triggers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ export async function verifyRowCountTriggers(): Promise<{
8181
incrementTrigger: boolean
8282
decrementTrigger: boolean
8383
}> {
84-
const result = await db.execute<{ tgname: string }[]>(`
84+
const result = (await db.execute(`
8585
SELECT tgname
8686
FROM pg_trigger
8787
WHERE tgname IN ('trg_increment_row_count', 'trg_decrement_row_count')
8888
AND NOT tgisinternal
89-
`)
89+
`)) as { tgname: string }[]
9090

9191
const triggers = Array.isArray(result) ? result.map((r) => r.tgname) : []
9292

0 commit comments

Comments
 (0)