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?
const encryptedEmails = emails.map(email => encryptColumn(email));

const fetchedUsers = await db
.select({
id: neptun_user.id,
})
.from(neptun_user)
/* @ts-ignore */
.where(inArray(neptun_user.primary_email, encryptedEmails))
.catch((err) => {
if (LOG_BACKEND) console.error('Failed to fetch user from database', err);
return null;
})
const encryptedEmails = emails.map(email => encryptColumn(email));

const fetchedUsers = await db
.select({
id: neptun_user.id,
})
.from(neptun_user)
/* @ts-ignore */
.where(inArray(neptun_user.primary_email, encryptedEmails))
.catch((err) => {
if (LOG_BACKEND) console.error('Failed to fetch user from database', err);
return null;
})
7 replies
DTDrizzle Team
Created by Jonas on 2/29/2024 in #help
ClientAuthentication Error using heroku-postgres
What do I have to do? This one is a heroku-postgres database (actually aws), it worked using a vercel-postgres database.
xxx\node_modules\drizzle-kit\bin.cjs:23472
const message = name === "notice" ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);

error: no pg_hba.conf entry for host "xxx", user "xxx", database "xxx", no encryption
at Parser.parseErrorMessage (xxx\node_modules\drizzle-kit\bin.cjs:23472:98)
at Parser.handlePacket (xxx\node_modules\drizzle-kit\bin.cjs:23313:25)
at Parser.parse (xxx\node_modules\drizzle-kit\bin.cjs:23237:34)
at Socket.<anonymous> (xxx\node_modules\drizzle-kit\bin.cjs:23513:44)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
at TCP.callbackTrampoline (node:internal/async_hooks:128:17) {
length: 175,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'auth.c',
line: '536',
routine: 'ClientAuthentication'
}

Node.js v18.19.0
xxx\node_modules\drizzle-kit\bin.cjs:23472
const message = name === "notice" ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);

error: no pg_hba.conf entry for host "xxx", user "xxx", database "xxx", no encryption
at Parser.parseErrorMessage (xxx\node_modules\drizzle-kit\bin.cjs:23472:98)
at Parser.handlePacket (xxx\node_modules\drizzle-kit\bin.cjs:23313:25)
at Parser.parse (xxx\node_modules\drizzle-kit\bin.cjs:23237:34)
at Socket.<anonymous> (xxx\node_modules\drizzle-kit\bin.cjs:23513:44)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
at TCP.callbackTrampoline (node:internal/async_hooks:128:17) {
length: 175,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'auth.c',
line: '536',
routine: 'ClientAuthentication'
}

Node.js v18.19.0
10 replies