* Get comprehensive statistics about the WAL file state. * Includes file information, open/close status, and last recovery state. * @returns Statistics object with file info and last recovery state
()
| 251 | * @returns Statistics object with file info and last recovery state |
| 252 | */ |
| 253 | getStats(): WalStats<T> { |
| 254 | const fileExists = fs.existsSync(this.#file); |
| 255 | return { |
| 256 | filePath: this.#file, |
| 257 | isClosed: this.#fd == null, |
| 258 | fileExists, |
| 259 | fileSize: fileExists ? fs.statSync(this.#file).size : 0, |
| 260 | lastRecovery: this.#lastRecoveryState, |
| 261 | }; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | export type WalRecord = object | string; |
no outgoing calls
no test coverage detected