import{entitiesAttributesTable as e}from"../../../../../providers/database/databases/sqlite-db/schemas/entities-attributes-table.js";import{logger as n}from"../../../../../tools/notifiers/logger.js";import{createEntityAttributesDbRecord as a}from"../../mappers/create-entity-attributes-db-record.js";class p{#t;constructor(t){this.#t=t}async upsertEntityAttributes({entityKey:t,rbacTeams:r,organizationId:i,projectId:o}){try{await this.#t.client.insert(e).values(a({rbacTeams:r,entityKey:t,organizationId:i,projectId:o})).onConflictDoUpdate({target:[e.entityKey],set:{rbacTeams:JSON.stringify(r)}}).run()}catch(s){n.error("Error saving entity attributes",s)}}}export{p as EntityAttributesWriteRepository};
