dafky2000
dafky2000
Explore posts from servers
DDeno
Created by dafky2000 on 12/16/2024 in #help
Wierd issue with uncaught exception in WebSocketPovider on Canary
My test is to connect to an invalid dns url.
2 replies
DTDrizzle Team
Created by dafky2000 on 11/19/2024 in #help
malformed array literal when trying to insert a 2d array of strings
Ended up (temporarily) solving this by manually creating the sql array and inserting that. I don't think this is a permanent solution because it opens up sql-injection risks. Hopefully it might help someone else with a temporary solution.
const sqlFrom2DArray = (arr: string[][]) => {
return sql`array[${sql.join(
arr.filter(a => a).map((subArray) => sql`[${sql.join(
subArray.filter(s => s).map((item) => sql.raw(`'${item}'`)), sql`, `
)}]`),
sql`, `
)}]::varchar[]`;
}
const sqlFrom2DArray = (arr: string[][]) => {
return sql`array[${sql.join(
arr.filter(a => a).map((subArray) => sql`[${sql.join(
subArray.filter(s => s).map((item) => sql.raw(`'${item}'`)), sql`, `
)}]`),
sql`, `
)}]::varchar[]`;
}
4 replies
DTDrizzle Team
Created by dafky2000 on 11/19/2024 in #help
malformed array literal when trying to insert a 2d array of strings
And... It's on a postgresql db using import { drizzle } from "drizzle-orm/node-postgres";
4 replies
DTDrizzle Team
Created by dafky2000 on 11/19/2024 in #help
malformed array literal when trying to insert a 2d array of strings
"drizzle-kit": "^0.28.1", "drizzle-orm": "^0.36.3"
4 replies