Release notes
Every release is on npm as @tapedb/tapedb with the same version in @tapedb/cli, @tapedb/react, @tapedb/auth, @tapedb/email and @tapedb/react-native. The full history with every commit is in the changelog on GitHub.
- A split holds writes for less. The shard that splits serves again as soon as it has the new directory, and tells the other shards afterwards, in parallel. Before, writes waited while every other shard read the directory from R2 in turn. The split’s answer now says where the time went (
phases). - Selling the last seats is faster. A shard that runs short of a
t.stock()quantity asks the other shards at once instead of one after another, and a shard that is busy is no longer taken for one with none left.
- Fixed: seats sold twice around a split. A shard keeps the rows it handed to a new shard hidden until it has deleted them, and its hold timer released those hidden copies too, so seats came back twice. Upgrade from 0.6.2 if you use
t.stock()holds or split shards. - Fixed: writes lost around a split. A write that reached a row the shard had just handed away changed the hidden copy instead of the row. It is now answered
movedand sent to the shard that has the row. - Fixed: a paid buyer told their payment failed. A transaction across shards retried after a split was refused with
conflictthough it had committed. It is now recognised as the same transaction. - An overloaded shard answers 503 with
Retry-After, which clients retry, instead of 500.
- Invites for built-in auth. An owner invites someone with a role and, optionally, an email address; the invitee opens the link, signs in and joins. An invite works once and expires after 7 days by default.
- Fixed: a transaction across shards could leave a shard refusing writes. When the shard deciding a transaction gave up waiting for its turn, it kept the transaction marked as being decided, so a shard holding its part heard “pending” each time it asked and refused every write until the object restarted. Every way out of a decision now ends it. 0.6.0 was not published to npm; install 0.6.1.
- Shards inside a workspace. A workspace can split into several Durable Objects, each the only writer of part of its rows, by hand (
npx @tapedb/cli shards split, orPOST /shards/split) or on its own withdefineTapeDB({ shards: { auto: true } })at 4 GB or a sustained 400 writes a second. A split keeps taking writes while it copies; writes wait only for its last step. See Scaling past one writer. - Partition keys.
model(...).partitionBy(key)keeps rows that share a key on one shard;{ buckets: n }spreads one busy key over several. - Transactions across shards commit on all of them or none, and a retry applies nothing twice. Reads, counts, aggregates, paging and live queries span shards and merge into the answer one shard would give.
- Unique fields stay unique across shards, and
.index({ global: true })lets a read of one value ask only the shards that hold it. t.stock(): a quantity many writers take from at once, kept as one pool per shard so no unit is sold twice. Holds take units until confirmed, released or ended.updatecan count with bounds:{ decrement: 1, min: 0 }.- Named SQL queries across shards with
shards: { key }orshards: { merge }, and published views: a named query anyone can read from the edge cache, run at most once per interval. See SQL queries. - Relays carry live queries past 2,000 sockets on a shard; viewers of the same query share one subscription.
- Splits, holds and transactions across shards are on the log, so a shard rebuilt from R2 finishes them.
/export,backup,restoreand erasing a workspace cover every shard.
- A refused claim stops the client from asking again. A
ClaimRefusedError, or anygetTokenerror withstatus401 or 403, is asked once: live queries reportunauthenticated, queued writes stay queued, and the client waits fordb.$reconnect(), a new subscription or the browser’sonlineevent. Network errors, 5xx and 429 still back off and retry. New exports:ClaimRefusedError,isClaimRefused.
- The client reuses a claim until 30 seconds before its
exp, and calls waiting together share onegetToken. A401on a write asks for a fresh token and sends the write once more. - A refused write no longer comes back after its rollback. With several writes in flight, the client now asks for its live queries again, so it shows the server’s rows with the still-pending writes over them.
db.$disconnect()anddb.$reconnect()take a client offline and back on purpose. While disconnected, writes apply optimistically and wait in the outbox;$reconnect()resubscribes, rejoins presence and topics, and sends the queued writes in order.
- Extensions are stable.
schema(models, { extensions }),defineTapeDB({ extensions }),@tapedb/tapedb/extensionand their types are part of the stable API, like the rest of it. No code changes.
- The schema may import
./namewithout an extension, as TypeScript and bundlers allow:./cms.contentfindscms.content.ts.tapedb add @tapedb/cmswrites that import, and on 0.5.0migratecould not load it. Under"type": "commonjs", give a helper the schema imports the.mtsextension.
- Extensions. A package can add to a TapeDB app in the schema, the Worker and the CLI at once;
@tapedb/cmsis the first.npx @tapedb/cli add <package>installs and lists it and runs its set-up, editing the schema, the Worker andwrangler.jsonconly where something is missing. See Extensions. - Schema.
schema(models, { extensions })adds an extension’s models beside the app’s, typed, and its file rules under one path prefix; a file takes the rule of the longest prefix that defines the action. - Worker.
defineTapeDB({ extensions }): routes for the requests TapeDB does not answer, ascheduledhandler on the Worker’s cron triggers, and change events delivered through the webhook outbox but as a call inside the workspace’s Durable Object, with no URL or secret. - CLI.
tapedb add,tapedb build,tapedb <extension> <command>andtapedb init --cms.tapedb devandtapedb deployrun each extension’s build first.
- A vector field.
t.vector({ dimensions })holds an embedding: one fixed length from 1 to 1,536, checked when the schema is written and again on every write. Values are stored as a singlef32le:v1:<base64>string, so a row comes back byte-identical through SQLite, the log, a snapshot, an export and a backup. Embeddings stay out of default reads and cannot be filtered, sorted, grouped or aggregated. - An index for it.
defineTapeDB({ vectorize })mirrors one model’s vector attribute into a Vectorize index. The work is queued inside the write’s own transaction and delivered from the durability alarm, so a commit never waits for the index and a failed delivery retries. A digest over the row, its bytes and the filter values decides what to send: nothing unchanged is re-sent, and a changed filter value still republishes. - Search by nearest neighbour.
db.model.search({ vector, limit, filter })returns the rows with theirscore. The query vector goes through the same codec a write does; every returned id is read back from the database, so a vector whose row was deleted is dropped rather than surfacing a row that is gone.limitdefaults to ten, fifty is the ceiling and a larger value is refused, and the answer says whether it was truncated. Filters are limited to the fields the deployment declared, and a search runs under the caller’s own read rules. - Erasing a workspace purges its vectors. A durable marker is written before anything is deleted and read immediately before each send, so a paused delivery and a retry recovered after the eviction cannot slip a write past it. Deletion is confirmed against the delete’s own mutation id — the provider’s watermark is not monotonic — and a restore publishes under the identity it is restored into, so a copy cannot carry vectors erased under the source.
@tapedb/react-nativeis the runtime package.AsyncStorageOutboxandcreateReactNativeClient, and nothing else: it peers on AsyncStorage and no longer on React. The hooks are@tapedb/react, the same module on web and on device.
- The client runs on React Native.
topicOriginwas initialised withcrypto.randomUUID()and the socket id did the same, and React Native has no Web Crypto, so constructing a client threw before the first render. Both now use the fallback the id generator already had. - The React Native examples pass the required
workspace, and$flush()is documented as it behaves: one delivery attempt that resolves when it finishes, not a wait for acknowledgement.
- React Native clears its queue again on AsyncStorage v3. v3 renamed the batch delete from
multiRemovetoremoveMany, soclear()threw, was caught by the fallback, and left every entry on disk while reporting an empty queue. The adapter takes whichever batch delete the installed release offers, or neither and deletes one key at a time, and the peer range covers v1, v2 and v3. - Deployment configuration no longer lives in module-level variables.
audit, file rules, realtime settings and webhooks were module-levellets that the lastdefineTapeDBin a process overwrote, so a second deployment inherited the first one’s settings. Configuration now travels with the room that owns it. - Presence refusals and webhook delivery are checked against the real runtime. A refusal names the room it refused and reaches only that room’s
onError; webhook delivery is asserted against a real HTTP receiver that recomputes the signature.
- React Native keeps its offline writes. The queue was IndexedDB-backed and RN has no IndexedDB, so a write made offline was fire-and-forget.
createClient({ outbox })acceptsOutbox | OutboxFactory, and@tapedb/react-nativesuppliesAsyncStorageOutboxpluscreateReactNativeClient. - The README’s claim that
npx @tapedb/cliupgrades the project’s core was wrong and is gone: the wrapper runs the release it pins and leaves the project’s copy alone. API.mdcontradicted itself about presence peers and the refusal channel; the statements now agree everywhere.
- Filters gain
$isNull,$likeand$ilike.$likecompiles to GLOB because SQLite’s LIKE is case-insensitive for ASCII, and$ilikefolds withLOWER()and is therefore ASCII-only. - Presence holds several rooms per socket, capped by
realtime.maxPresenceRooms(4 by default), with an 8 KiB per-socket budget and onerealtime.authorizefor presence and topics. Peers include the caller markedisSelf, and a refused join reachesonErrorwith the room named. - Broadcast reports loss.
onGapreceives{ topic, expected, received }, andlastSeqandgaplet a caller resynchronise. Broadcast remains experimental. - Webhooks.
defineTapeDB({ webhooks })delivers signed change events, captured by triggers inside the write’s own transaction and sent after commit, so a webhook can never fail a commit. - Write budgets.
defineTapeDB({ limits })sets per-model and per-workspace budgets in the workspace’s own SQLite; a refused write israte_limitedwith the limit, the window andretryAfterMs. - An opt-in HTTP API for backends:
POST /v1/query,/v1/transactand/v1/claim, evaluating the same rules a socket claim would. Without the option the routes answer 404, not 401. - Every public entry has one scoped name:
@tapedb/cli,@tapedb/react,@tapedb/auth,@tapedb/email. The subpaths still resolve to the same module. - A whole-row update could be recorded as an insert, because insert and update were told apart by comparing
created_attoupdated_at, which are equal on an insert.