MCPcopy
hub / github.com/streetwriters/notesnook / delete

Method delete

packages/core/src/database/sql-collection.ts:140–158  ·  view source on GitHub ↗
(ids: string[])

Source from the content-addressed store, hash-verified

138 }
139
140 async delete(ids: string[]) {
141 if (ids.length <= 0) return;
142
143 await this.db()
144 .transaction()
145 .execute(async (tx) => {
146 for (const chunk of toChunks(ids, MAX_SQL_PARAMETERS)) {
147 await tx
148 .deleteFrom<keyof DatabaseSchema>(this.type)
149 .where("id", "in", chunk)
150 .execute();
151 }
152 });
153 this.eventManager.publish(EVENTS.databaseUpdated, <DeleteEvent>{
154 type: "delete",
155 collection: this.type,
156 ids
157 });
158 }
159
160 async exists(id: string) {
161 const { count } =

Callers

nothing calls this directly

Calls 4

toChunksFunction · 0.85
whereMethod · 0.80
executeMethod · 0.45
publishMethod · 0.45

Tested by

no test coverage detected