@backstage-community/plugin-rbac-backend
Version:
27 lines (23 loc) • 964 B
JavaScript
;
var ancestorSearchMemoPg = require('./ancestor-search-memo-pg.cjs.js');
var ancestorSearchMemoSqlite = require('./ancestor-search-memo-sqlite.cjs.js');
class AncestorSearchFactory {
static async createAncestorSearchMemo(userEntityRef, config, catalogAPI, catalogDBClient, authService, maxDepth) {
const databaseConfig = config.getOptionalConfig("backend.database");
const client = databaseConfig?.getOptionalString("client");
if (client === "pg") {
return new ancestorSearchMemoPg.AncestorSearchMemoPG(userEntityRef, catalogDBClient, maxDepth);
}
if (client === "better-sqlite3") {
return new ancestorSearchMemoSqlite.AncestorSearchMemoSQLite(
userEntityRef,
catalogAPI,
authService,
maxDepth
);
}
throw new Error(`Unsupported database: ${client}`);
}
}
exports.AncestorSearchFactory = AncestorSearchFactory;
//# sourceMappingURL=ancestor-search-factory.cjs.js.map