MCPcopy Create free account
hub / github.com/cameri/nostream / deleteByPubkeyAndIds

Method deleteByPubkeyAndIds

src/repositories/event-repository.ts:367–378  ·  view source on GitHub ↗
(pubkey: string, eventIdsToDelete: EventId[])

Source from the content-addressed store, hash-verified

365 }
366
367 public deleteByPubkeyAndIds(pubkey: string, eventIdsToDelete: EventId[]): Promise<number> {
368 logger('deleting events from %s: %o', pubkey, eventIdsToDelete)
369
370 return this.masterDbClient('events')
371 .where('event_pubkey', toBuffer(pubkey))
372 .whereIn('event_id', map(toBuffer)(eventIdsToDelete))
373 .whereNot('event_kind', EventKinds.REQUEST_TO_VANISH)
374 .whereNull('deleted_at')
375 .update({
376 deleted_at: this.masterDbClient.raw('now()'),
377 })
378 }
379
380 public deleteByPubkeyExceptKinds(pubkey: string, excludedKinds: number[]): Promise<number> {
381 logger('deleting events from %s except kinds %o', pubkey, excludedKinds)

Callers

nothing calls this directly

Calls 1

toBufferFunction · 0.90

Tested by

no test coverage detected