let users = await db.query.UsersTable.findMany({ extras: { targetName: sql<string>`lower(${UsersTable.firstName})`.as("target_name") }, where: () => and( inArray( UsersTable.id, employeesRoles.map((r) => r.userId) ), // here i need to use target_name for querying ), with: { roles: true } });