* 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)
| 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, |
no test coverage detected