ハウス
ハウス
Explore posts from servers
CDCloudflare Developers
Created by ハウス on 12/7/2023 in #workers-help
Workers IPs for AWS inbound allowed list
Where can I found the workers expose IP list that I can add to AWS inbound allowed IP list.
3 replies
DTDrizzle Team
Created by ハウス on 11/22/2023 in #help
Multi-service, different schema in one database (postgres)
Sorry if it's duplicate, I can't find it after trying to search for a while. My use case is: I use drizzle with multiple service, every service connect to the same database instance and same database, separate by the schema. So far so good until I try to run migration, the migration script only do migrate the first schema only. But no error occurs in the command line. Did I do anything wrong? My migration script:
import { drizzle } from 'drizzle-orm/postgres-js'
import { migrate } from 'drizzle-orm/postgres-js/migrator'
import postgres from 'postgres'
import * as dotenv from 'dotenv'
dotenv.config({
path: '.dev.vars'
})

const sql = postgres(process.env.X_DB_CONNECTION as string, { max: 1 })
const db = drizzle(sql)

async function main () {
console.log('Migration start...')
await migrate(db, { migrationsFolder: 'migration' })
console.log('Migration completed...')

process.exit(0)
}
main().catch(err => {
console.log(err)
process.exit(0)
})
import { drizzle } from 'drizzle-orm/postgres-js'
import { migrate } from 'drizzle-orm/postgres-js/migrator'
import postgres from 'postgres'
import * as dotenv from 'dotenv'
dotenv.config({
path: '.dev.vars'
})

const sql = postgres(process.env.X_DB_CONNECTION as string, { max: 1 })
const db = drizzle(sql)

async function main () {
console.log('Migration start...')
await migrate(db, { migrationsFolder: 'migration' })
console.log('Migration completed...')

process.exit(0)
}
main().catch(err => {
console.log(err)
process.exit(0)
})
Cli response
pnpm db:migrate

> @ampos-x/[email protected] db:migrate /Users/sittiponghaus/project/@x/apps/access-control-api
> tsx -r ./migrate.ts

Migration start...
Welcome to Node.js v19.9.0.
Type ".help" for more information.
> {
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '131',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
Migration completed...
pnpm db:migrate

> @ampos-x/[email protected] db:migrate /Users/sittiponghaus/project/@x/apps/access-control-api
> tsx -r ./migrate.ts

Migration start...
Welcome to Node.js v19.9.0.
Type ".help" for more information.
> {
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '131',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
Migration completed...
There're no errors but the table wasn't create. Please help suggest.
2 replies
CDCloudflare Developers
Created by ハウス on 8/4/2023 in #workers-help
Is it possible to send a message via api request to the websocket client
Hi everyone, I'm trying to do the pusher like behavior which allowed the worker to send a message to user via websocket with userId. Any idea?
1 replies