Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: add table names to referenced cols in secret import count query

Scott Wilson60cb66b5f5df
diff --git a/backend/src/services/secret-import/secret-import-dal.ts b/backend/src/services/secret-import/secret-import-dal.ts
index f14daac133..cf464c8283 100644
--- a/backend/src/services/secret-import/secret-import-dal.ts
+++ b/backend/src/services/secret-import/secret-import-dal.ts
@@ -173,11 +173,11 @@ export const secretImportDALFactory = (db: TDbClient) => {
const getUniqueImportCountByFolderIds = async (folderIds: string[], search?: string, tx?: Knex) => {
try {
const docs = await (tx || db.replicaNode())(TableName.SecretImport)
- .whereIn("folderId", folderIds)
- .where("isReserved", false)
+ .whereIn(`${TableName.SecretImport}.folderId`, folderIds)
+ .where(`${TableName.SecretImport}.isReserved`, false)
.where((bd) => {
if (search) {
- void bd.whereILike("importPath", `%${search}%`);
+ void bd.whereILike(`${TableName.SecretImport}.importPath`, `%${search}%`);
}
})
.join(TableName.Environment, `${TableName.SecretImport}.importEnv`, `${TableName.Environment}.id`)