@rotorsoft/act-sqlite 1.12.15 → 1.13.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
@@ -54,7 +54,7 @@ Full type reference: [typedoc](https://github.com/Rotorsoft/act-root/blob/master
54
54
 
55
55
  | Option | Default | Description |
56
56
  |---|---|---|
57
- | `url` | `file::memory:` | libSQL connection URL. Use `file:path.db` for persistent file, `libsql://…` for Turso. |
57
+ | `url` | **required** | libSQL connection URL. Use `file:path.db` for a persistent file, `libsql://…` for Turso, `:memory:` for the shared in-memory database. |
58
58
  | `authToken` | — | Auth token for libSQL server connections (Turso). |
59
59
 
60
60
  ### File-based persistence
@@ -66,9 +66,22 @@ store(new SqliteStore({ url: "file:data/events.db" }));
66
66
  ### In-memory (tests / quick experiments)
67
67
 
68
68
  ```ts
69
- store(new SqliteStore()); // defaults to file::memory:
69
+ store(new SqliteStore({ url: ":memory:" }));
70
70
  ```
71
71
 
72
+ There is no default `url` — a store has to be told where to write, and
73
+ constructing one without a URL throws. libSQL gives every *connection* its
74
+ own private in-memory database and does not pin statements to a single
75
+ connection, so a zero-config store used to accept writes into a database
76
+ the next statement could not see. `:memory:` is therefore normalized to
77
+ libSQL's shared-cache form, the only one that round-trips.
78
+
79
+ That comes with a caveat: the shared-cache database is **one per process**,
80
+ visible to every store pointed at it, and it outlives `dispose()`. For
81
+ isolated throwaway state — parallel tests, two independent stores in one
82
+ process — use `InMemoryStore` from `@rotorsoft/act`, or give each store its
83
+ own `file:` path.
84
+
72
85
  ### Turso (edge)
73
86
 
74
87
  ```ts