Skip to content

Commit 35ec16e

Browse files
committed
fix: fix format
1 parent d680e75 commit 35ec16e

6 files changed

Lines changed: 2872 additions & 5822 deletions

File tree

packages/hyperdb-doc/src/content/docs/integrations/react.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ Use `useSelect` for synchronous drivers.
223223

224224
## Hook reference
225225

226-
| Hook | Returns | Use with |
227-
| ------------------------ | ------------------------------ | ------------------------------------------ |
228-
| `useDB()` | the `SubscribableDB` | accessing the DB directly |
229-
| `useAsyncSelector(opts)` | query-style result object | `HybridDB`, IndexedDB, async SQLite |
230-
| `useSyncSelector(opts)` | the selector result | in-memory and sync SQLite |
231-
| `useAsyncDispatch()` | `(action) => Promise<TReturn>` | `HybridDB`, IndexedDB, async SQLite |
232-
| `useDispatch()` | `(action) => TReturn` | in-memory and sync SQLite |
233-
| `useAsyncSelect()` | `(gen) => Promise<TReturn>` | one-off read, async runtimes |
234-
| `useSelect()` | `(gen) => TReturn` | one-off read, sync runtimes |
226+
| Hook | Returns | Use with |
227+
| ------------------------ | ------------------------------ | ----------------------------------- |
228+
| `useDB()` | the `SubscribableDB` | accessing the DB directly |
229+
| `useAsyncSelector(opts)` | query-style result object | `HybridDB`, IndexedDB, async SQLite |
230+
| `useSyncSelector(opts)` | the selector result | in-memory and sync SQLite |
231+
| `useAsyncDispatch()` | `(action) => Promise<TReturn>` | `HybridDB`, IndexedDB, async SQLite |
232+
| `useDispatch()` | `(action) => TReturn` | in-memory and sync SQLite |
233+
| `useAsyncSelect()` | `(gen) => Promise<TReturn>` | one-off read, async runtimes |
234+
| `useSelect()` | `(gen) => TReturn` | one-off read, sync runtimes |

packages/hyperdb-doc/src/content/docs/runtime/db.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ commands.
1010

1111
## Which runtime should I use?
1212

13-
| Runtime shape | Use when | Tradeoff |
14-
| ------------- | -------- | -------- |
15-
| `DB` | You only need `select`, `insert`, `upsert`, `deleteRows`, and transactions. | Lowest overhead. No subscriptions, reactive selector cache, revisions, or lifecycle hooks. |
16-
| `SubscribableDB` + sync driver | Your reactive app can load its working state into memory. | Best interactive path: selectors and actions can stay synchronous with `useSyncSelector`, `useDispatch`, `select`, and `syncDispatch`. |
17-
| `SubscribableDB` + async driver | Your reactive app should keep memory low and read directly from IndexedDB or async SQLite. | Uses async selectors/actions. Simpler than `HybridDB`, but every read follows the async driver path. |
18-
| `SubscribableDB` + `HybridDB` | Local-first browser apps that want persistent storage plus fast reads for hot data. | Uses async APIs, but reads check the in-memory cache first. Missing index ranges fall through to the primary store, then get cached for next time. Writes update the cache first for immediate UI response, then flush to the primary store. |
13+
| Runtime shape | Use when | Tradeoff |
14+
| ------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15+
| `DB` | You only need `select`, `insert`, `upsert`, `deleteRows`, and transactions. | Lowest overhead. No subscriptions, reactive selector cache, revisions, or lifecycle hooks. |
16+
| `SubscribableDB` + sync driver | Your reactive app can load its working state into memory. | Best interactive path: selectors and actions can stay synchronous with `useSyncSelector`, `useDispatch`, `select`, and `syncDispatch`. |
17+
| `SubscribableDB` + async driver | Your reactive app should keep memory low and read directly from IndexedDB or async SQLite. | Uses async selectors/actions. Simpler than `HybridDB`, but every read follows the async driver path. |
18+
| `SubscribableDB` + `HybridDB` | Local-first browser apps that want persistent storage plus fast reads for hot data. | Uses async APIs, but reads check the in-memory cache first. Missing index ranges fall through to the primary store, then get cached for next time. Writes update the cache first for immediate UI response, then flush to the primary store. |
1919

2020
## `DB`
2121

packages/hyperdb-doc/src/content/docs/runtime/drivers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ the sync or async runtime helpers, which depends on the storage path.
1313

1414
## Choosing a driver
1515

16-
| Driver | Import | Mode | Environment | Use for |
17-
| ------------------- | ---------------------- | ----- | ----------- | ------------------------------------------------------------- |
18-
| `BptreeInmemDriver` | `.../drivers/inmemory` | sync | both | Tests, fully loaded app state, and the fast `HybridDB` cache |
19-
| `IdbDriver` | `.../drivers/idb` | async | browser | Browser persistence, usually as a `HybridDB` primary store |
20-
| `SqlDriver` | `.../drivers/sqlite` | sync | both | Any synchronous SQLite binding (native server SQLite, sql.js) |
16+
| Driver | Import | Mode | Environment | Use for |
17+
| ------------------- | ---------------------- | ----- | ----------- | -------------------------------------------------------------- |
18+
| `BptreeInmemDriver` | `.../drivers/inmemory` | sync | both | Tests, fully loaded app state, and the fast `HybridDB` cache |
19+
| `IdbDriver` | `.../drivers/idb` | async | browser | Browser persistence, usually as a `HybridDB` primary store |
20+
| `SqlDriver` | `.../drivers/sqlite` | sync | both | Any synchronous SQLite binding (native server SQLite, sql.js) |
2121
| `AsyncSqlDriver` | `.../drivers/sqlite` | async | both | Async SQLite, including browser SQLite as a `HybridDB` primary |
2222

2323
Sync drivers work with `execSync` / `syncDispatch` / `select`. Async drivers

packages/hyperdb-doc/src/content/docs/start/why.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ that can fetch indexed ranges and receive mutations, then maintain derived views
244244
incrementally. That is a possible future extension, not a contradiction of the
245245
core design.
246246

247-
248247
## In short
249248

250249
HyperDB exists because local-first apps need:

packages/hyperdb/devtool.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Exports from `@will-be-done/hyperdb-devtool/react`:
3232

3333
`HyperDBDevtools` props:
3434

35-
| Prop | Meaning |
36-
| ---- | ------- |
37-
| `db?: SubscribableDB` | Trace one DB explicitly. If omitted, the devtool tries `DBProvider` context and registered DB discovery. |
38-
| `initialIsOpen?: boolean` | Initial panel state before localStorage is read. |
39-
| `position?: "top" \| "bottom" \| "left" \| "right"` | Dock position, default `"bottom"`. |
40-
| `buttonPosition?: "top-left" \| "top-right" \| "bottom-left" \| "bottom-right"` | Floating button position, default `"bottom-right"`. |
41-
| `maxTraces?: number` | Visible/retained trace cap for the devtool view, default `200`. |
42-
| `theme?: "dark" \| "light" \| "system"` | Theme selection, default `"system"`. |
35+
| Prop | Meaning |
36+
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
37+
| `db?: SubscribableDB` | Trace one DB explicitly. If omitted, the devtool tries `DBProvider` context and registered DB discovery. |
38+
| `initialIsOpen?: boolean` | Initial panel state before localStorage is read. |
39+
| `position?: "top" \| "bottom" \| "left" \| "right"` | Dock position, default `"bottom"`. |
40+
| `buttonPosition?: "top-left" \| "top-right" \| "bottom-left" \| "bottom-right"` | Floating button position, default `"bottom-right"`. |
41+
| `maxTraces?: number` | Visible/retained trace cap for the devtool view, default `200`. |
42+
| `theme?: "dark" \| "light" \| "system"` | Theme selection, default `"system"`. |
4343

4444
## Runtime Tracing
4545

0 commit comments

Comments
 (0)