MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / rebind

Method rebind

src/db/queries.ts:603–615  ·  view source on GitHub ↗

* Swap the underlying connection in place. Used by pool workers' * connection recycling (plan §7a.6, writes-under-readers): a long-lived * read connection pins WAL checkpoint progress, and the deep WAL that * accumulates behind it taxes every main-thread B-tree page operation * (deletes

(db: SqliteDatabase)

Source from the content-addressed store, hash-verified

601 * lazily on next use.
602 */
603 rebind(db: SqliteDatabase): void {
604 this.db = db;
605 this.stmts = {};
606 this.batchStmts.clear();
607 this.edgeKindStmts.clear();
608 this.flowQueries = undefined;
609 // The change stamp is per connection, and fresh connections to two
610 // different databases report the same one — the memo goes with the old
611 // connection, or a worker following a rebuilt index keeps its answer (#1864).
612 this.dominantFileMemo = undefined;
613 this.readMemos.clear();
614 this.presentSchema.clear();
615 }
616
617 /**
618 * Tables (`name`) and columns (`table.column`) that later migrations added,

Callers 2

resolver-worker.tsFile · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected