(id: string, sector: string, vector: number[], dim: number, user_id?: string)
| 15 | } |
| 16 | |
| 17 | async storeVector(id: string, sector: string, vector: number[], dim: number, user_id?: string): Promise<void> { |
| 18 | const v = vectorToBuffer(vector); |
| 19 | const sql = `insert into ${this.table}(id,sector,user_id,v,dim) values($1,$2,$3,$4,$5) on conflict(id,sector) do update set user_id=excluded.user_id,v=excluded.v,dim=excluded.dim`; |
| 20 | await this.db.run_async(sql, [id, sector, user_id || "anonymous", v, dim]); |
| 21 | } |
| 22 | |
| 23 | async deleteVector(id: string, sector: string): Promise<void> { |
| 24 | await this.db.run_async(`delete from ${this.table} where id=$1 and sector=$2`, [id, sector]); |
nothing calls this directly
no test coverage detected