Jonas
Jonas
Explore posts from servers
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
same issue with raw sql, seems like functions do not work in postgres IN
const encryptedEmails = emails.map(email => encryptColumn(email));
const fetchedUsers = await db.execute<ReadChatConversationShare>(sql`SELECT id FROM neptun_user WHERE primary_email IN (${sql.join(encryptedEmails, sql`, `)})`);
const encryptedEmails = emails.map(email => encryptColumn(email));
const fetchedUsers = await db.execute<ReadChatConversationShare>(sql`SELECT id FROM neptun_user WHERE primary_email IN (${sql.join(encryptedEmails, sql`, `)})`);
7 replies
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
also tried like this: .where(sqlneptun_user.primary_email IN (${sql.join(encryptedEmails, sql, )}))
7 replies
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
test@gmx.at exists and the result is an empty array
7 replies
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
I feel like this just compares the strings and not the computed values
7 replies
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
This doesn't seem to work properly. Can i not use functions inside of inArray?
7 replies
DTDrizzle Team
Created by Jonas on 8/24/2024 in #help
How do I dynamically insert multiple encrypted values?
The code above creates this:
Query: select "id" from "neptun_user" where "neptun_user"."primary_email" in (encode(encrypt($1, $2, 'aes'), 'hex'), encode(encrypt($3, $4, 'aes'), 'hex'), encode(encrypt($5, $6, 'aes'), 'hex')) -- params: ["test@gmx.at", "xxx", "test1@gmx.at", "xxx", "test2@gmx.at", "xxx"]
Query: select "id" from "neptun_user" where "neptun_user"."primary_email" in (encode(encrypt($1, $2, 'aes'), 'hex'), encode(encrypt($3, $4, 'aes'), 'hex'), encode(encrypt($5, $6, 'aes'), 'hex')) -- params: ["test@gmx.at", "xxx", "test1@gmx.at", "xxx", "test2@gmx.at", "xxx"]
7 replies