## Summary
- track sessions created by `DatabaseSync`
- close and invalidate active sessions before closing the database
connection
- keep sessions from an earlier connection closed after the database is
reopened
## Motivation
Session objects checked whether the database's shared connection state
was populated. Reopening the database populated that state again, so
sessions created for the previous connection could be treated as open.
Tying each session handle to the database's active-session list keeps
its lifecycle associated with the connection that created it.
## Testing
- `cargo check -p deno --lib`
- `cargo test unit_node::sqlite_test`
- `./tools/format.js ext/node_sqlite/database.rs
ext/node_sqlite/session.rs tests/unit_node/sqlite_test.ts`
- `./tools/lint.js`
I let claude loose on improving compile times and it suggested splitting
up `deno_node` by extracting the crypto stuff and node sqlite. And the
other change is getting rid of all unused constants in `winerror.rs`.
That changes it from 17k lines down to 240.
| What | Time | Delta |
|---|--:|--:|
| main | 214.6s | - |
| PR | **162.8s** | **-51.8s** |
## Summary of changes
1. deno_node compile: -13.4s (48%) - Splitting out crypto and sqlite
plus removing 16K lines of unused winerror constants nearly halved
compile time.
2. deno_runtime: -5.2s (36%) - Less debug info to process.
3. Parallelism gains - deno_node_crypto (8.3s) and deno_node_sqlite
(2.5s) now compile concurrently with other work instead of being
serialized inside the monolithic deno_node.
Total CPU time for node crates
- Before: deno_node = 50.1s (both passes)
- After: deno_node (27.5s) + deno_node_crypto (16.5s) + deno_node_sqlite
(4.7s) = 48.6s
- Similar CPU time, but wall-clock is much better due to parallelism.