tazmaniax
tazmaniax
DTDrizzle Team
Created by tazmaniax on 11/28/2024 in #help
Unable to pass JSON array to PostgreSQL function jsonb[] parameter using execute raw SQL
When I run the following query I get the error PostgresError: malformed array literal: "[{"data":"test batch message 1"},{"data":"test batch message 2"}]
const msgs = [
{ data: "test batch message 1" },
{ data: "test batch message 2" },
]
const result = await this.db.execute<{ send_batch: number }>(
sql`SELECT * FROM pgmq.send_batch(${this.queueName}, ${JSON.stringify(msgs)}::jsonb[], ${delay})`,
)
const msgs = [
{ data: "test batch message 1" },
{ data: "test batch message 2" },
]
const result = await this.db.execute<{ send_batch: number }>(
sql`SELECT * FROM pgmq.send_batch(${this.queueName}, ${JSON.stringify(msgs)}::jsonb[], ${delay})`,
)
2 replies
DTDrizzle Team
Created by tazmaniax on 11/25/2024 in #help
drizzle-kit introspect schemaFilters parameter ignored
When I try to execute the following on the command line, always the "public" schema is used and not the "pgmq" schema. It's as though --schemaFilters is being ignored. Am I doing something wrong?
npx drizzle-kit introspect --url="postgresql://postgres:[email protected]:54322/postgres" --dialect=postgresql --schemaFilters pgmq --out test

Pulling from ['public'] list of schemas
npx drizzle-kit introspect --url="postgresql://postgres:[email protected]:54322/postgres" --dialect=postgresql --schemaFilters pgmq --out test

Pulling from ['public'] list of schemas
2 replies