latticesql 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2173,8 +2173,8 @@ await lattice.init();
2173
2173
 
2174
2174
  **Two surfaces, one adapter (since 1.8.0):**
2175
2175
 
2176
- - **Sync surface** (`run` / `get` / `all` / `prepare`) — bridged via a synckit worker thread that owns a single `pg.Client`. The main thread blocks on `Atomics.wait` until the worker replies. Each query pays ~1–3 ms of message-passing overhead. Used by callers that haven't migrated to the async surface yet; preserved for back-compat.
2177
- - **Async surface** (`runAsync` / `getAsync` / `allAsync` / `prepareAsync` / `withClient`) — native against a `pg.Pool` in the main thread. No synckit, no `Atomics.wait`. The Node event loop is free to handle other work between awaited DB roundtrips. Required for any workload that runs long sync bursts on the main thread; `pool.max` is configurable via `PostgresAdapterOptions.poolSize` (default 10).
2176
+ - **Sync surface** (`run` / `get` / `all` / `prepare`) — bridged via a synckit worker thread that owns a single `pg.Client`. The main thread blocks on `Atomics.wait` until the worker replies. Each query pays ~1–3 ms of message-passing overhead. Preserved for back-compat with third-party adapters that don't implement the async surface; lattice itself no longer uses it on the hot path.
2177
+ - **Async surface** (`runAsync` / `getAsync` / `allAsync` / `prepareAsync` / `withClient`) — native against a `pg.Pool` in the main thread. No synckit, no `Atomics.wait`. The Node event loop is free to handle other work between awaited DB roundtrips. **Since 1.9.0, lattice core internally prefers this surface at every call site** when the configured adapter implements it (Postgres) — fall-back to the sync surface only when the adapter doesn't expose async methods (SQLite). `pool.max` is configurable via `PostgresAdapterOptions.poolSize` (default 10).
2178
2178
  - **Transactional contract**: any code that issues `BEGIN`/`COMMIT` should use `withClient(fn)` rather than raw `adapter.run('BEGIN')`. The pool checks out a single connection for the lifetime of `fn` and the `TxClient` handed to `fn` pins every query to that connection. Raw `adapter.run('BEGIN')` is only safe under the synckit worker (single-connection by construction); the next major release will remove the synckit worker entirely.
2179
2179
 
2180
2180
  ```ts