Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Importing and Exporting #2

Open
kitsonk opened this issue Nov 10, 2024 · 0 comments
Open

Proposal: Importing and Exporting #2

kitsonk opened this issue Nov 10, 2024 · 0 comments

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Nov 10, 2024

Another utility the is in kv-toolbox that could be generally useful and builds on the JSON serialization schema is the ability to import and export as NDJSON (new line delimitated JSON) which is a format often used for logs and other situations where the data payload needs to be streamed.

I would propose adapting the following from kv-toolbox:

  • exportEntries(db, selector, options?) - Would have overloads that returned a ReadableStream<Uint8Array>, ReadableStream<string> or a Response with a body which would stream the selected records.
  • importEntries(db, data, options?) - Would be able to import entries from the data source which could be ReadableStream<Uint8Array>, Blob/File, ArrayBufferView, ArrayBuffer or string.

This would allow users to provide the ability to provide interfaces to "download" data stored in a KV store as well as import it. Also because it would leverage the JSON schema it would allow implementors to do additional pre or post processing or procedural generation of data which can be stored in KV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant