add export/import streaming to the pluggable backends #13
No Reviewers
Labels
Clear labels
Agentic
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Agent
Fable
Work made by a Claude Fable agent
Agent
gpt-5.6-luna
Work made by a gpt-5.6-luna agent
Agent
gpt-5.6-sol
Work made by a gpt-5.6-sol agent
Agent
gpt-5.6-terra
Work made by a gpt-5.6-terra agent
Work made by an agent
Agent
Opus
Work made by a Claude Opus agent
Agent
Sonnet
Work made by a Claude Sonnet agent
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Reference: codinget/abode#13
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Adds backend-agnostic export / import streaming to the pluggable-backend abstraction, plus an inspect utility, three CLIs, and an HTTP export endpoint. Enables migrating data off a shared instance, moving between backend engines, and plain-file backups.
Wire format: NDJSON, one
{"kind","data"}envelope per line; leadingmetaline records format version, timestamp, source backend, and the effective (possibly narrowed) filter.What is in here
ExportImporttypes + filter helpers (kind/record scoping, hard-intersection of filters).Exportable+Importable: signal-checked async-generator export (one query per table, per-record yield, trailingerrorsentinel on mid-stream failure); manually-driven import transaction that rolls back on any error/abort and never commits partial data.Exportablevia its ownfetch({signal})(import stays sqlite-only).computeForcedExportFilterforces non-global-admin callers to their resided-in abodes + co-resident users (∩ apikeyrestrict_*);GET /exportintersects with the caller filter and wires anAbortControllerto the response socket.abode-export,abode-import,abode-inspect.Notes / decisions
#unsetpasswords; apikeys are re-minted a token (theClientApikeyview round-trips exactly).notekind is fully supported (Notes CRUD already landed), not a no-op.test/suite (test/tools/export-import.test.ts), not a fresh setup.created_by/updated_byload cleanly.Testing
npm run typecheck+typecheck:testclean.cancelledByParentin the bs3 wrapped-db suite); node:sqlite path is unaffected.TODO before merge
exportScope.ts🤖 Generated with Claude Code
Add backend-agnostic data export/import over an NDJSON wire format, plus an inspect utility, exposed via three new CLIs and an HTTP export endpoint. - ExportImport types + filter helpers (kind/record scoping, hard-intersection of filters) in src/db/{types/ExportImport,export/filter}.ts - SqliteInterface implements Exportable + Importable: signal-checked async generator export (one query per table, per-record yield, trailing error sentinel on mid-stream failure) and a manually-driven import transaction that rolls back on any error/abort and never commits partial data - ApiInterface implements Exportable via its own fetch({signal}) - computeForcedExportFilter enforces non-global-admin scope (resided-in abodes + co-resident users, intersected with apikey restrict_*); GET /export intersects it with the caller's filter and wires an AbortController to the response socket - inspectExportStream reports kinds/counts from any stream without a db - abode-export / abode-import / abode-inspect CLIs (import is sqlite-only) - Secrets are not exported: imported users default to '#unset' passwords and apikeys are re-minted a token (ClientApikey view round-trips exactly) - test/tools/export-import.test.ts: round-trip, filter narrowing, forced-scope, export/import cancellation, in-process Koa endpoint, inspect Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>421a70780atoccb970f200