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
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
Using neon now. heroku-postgres sucks.
10 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
What am I supposed to do?
10 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
I still don't get it
10 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
the vercel one is from neon
10 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
i added ?sslmode=require to my database url. now i get DEPTH_ZERO_SELF_SIGNED_CERT. I don't have acces to the account. how am I supposed to sign it with the cert of the database?
10 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
my config:
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
schema: "./schema.ts",
out: "./drizzle",
driver: "pg",
dbCredentials: {
connectionString: process.env.DATABASE_HOST!
},
verbose: true
})
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
schema: "./schema.ts",
out: "./drizzle",
driver: "pg",
dbCredentials: {
connectionString: process.env.DATABASE_HOST!
},
verbose: true
})
10 replies