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;
    })
Was this page helpful?