TOSL
TOSL
Explore posts from servers
DTDrizzle Team
Created by TOSL on 10/27/2024 in #help
.array() can't automatically type cast
export const recurrencePattern = createTable(
"recurrence_pattern",
{
id: serial().primaryKey(),
type: varchar({ length: 50 }).notNull(),
daysOfWeek: integer().array().default(sql`'{}'::integer[]`),
endsAt: timestamp({ withTimezone: true }),
createdAt: timestamp({ withTimezone: true })
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
}
);
export const recurrencePattern = createTable(
"recurrence_pattern",
{
id: serial().primaryKey(),
type: varchar({ length: 50 }).notNull(),
daysOfWeek: integer().array().default(sql`'{}'::integer[]`),
endsAt: timestamp({ withTimezone: true }),
createdAt: timestamp({ withTimezone: true })
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
}
);
PostgresError: column "daysOfWeek" cannot be cast automatically to type integer[]
at ErrorResponse (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:788:26)
at handle (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:474:6)
at TLSSocket.data (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:315:9)
at TLSSocket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
severity_local: 'ERROR',
severity: 'ERROR',
code: '42804',
hint: 'You might need to specify "USING "daysOfWeek"::integer[]".',
file: 'tablecmds.c',
line: '12391',
routine: 'ATPrepAlterColumnType'
}
PostgresError: column "daysOfWeek" cannot be cast automatically to type integer[]
at ErrorResponse (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:788:26)
at handle (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:474:6)
at TLSSocket.data (file:///Users/shawn/dev/rally/node_modules/postgres/src/connection.js:315:9)
at TLSSocket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
severity_local: 'ERROR',
severity: 'ERROR',
code: '42804',
hint: 'You might need to specify "USING "daysOfWeek"::integer[]".',
file: 'tablecmds.c',
line: '12391',
routine: 'ATPrepAlterColumnType'
}
3 replies
TTCTheo's Typesafe Cult
Created by TOSL on 12/31/2023 in #questions
clerk webhooks not working
I'm trying to setup clerk webhooks to sync with my db. I setup an api route but when I set the webhook endpoint to that route on the clerk dashboard it says I get a "not found" error. When I test the ngrok url webhook endpoint without the addition of the api route "/api/webhooks/clerk" the test response is a success but when add the rest of the route it fails. I read the clerk docs and I don't think I've missed anything. I'm using ngrok to expose my localhost and I made the webhook routes public with the middleware Anyone have any ideas what I'm doing wrong?
2 replies
TTCTheo's Typesafe Cult
Created by TOSL on 11/14/2023 in #questions
Setup for seeding db using Drizzle
Hi. Pretty much what the title says. I'm looking for some instruction how to setup seeding my planetscale mysql db using Drizzle
5 replies