framework icon indicating copy to clipboard operation
framework copied to clipboard

Expose SQLite.export().

Open angrytongan opened this issue 1 year ago • 3 comments
trafficstars

angrytongan avatar Oct 13 '24 04:10 angrytongan

This is interesting. Can we clarify what the use case is, though? I can see how re-importing the same data is useful to show that it works, but besides the demo would you want to reuse that export on the same page? Or is it more—say—that you would use the page to edit a db, then click on a button to download an export or save it to an asset server?

Fil avatar Oct 14 '24 16:10 Fil

Maybe the better solution here would be to document how to access the underlying SQLite instance. I don’t think we want to create wrapper functions for everything that SQLite supports, especially if it’s not a use case we expect is common.

mbostock avatar Oct 14 '24 19:10 mbostock

Can we clarify what the use case is, though?

🤔 I want to persist the SQLite database at the client by puling it out with export() and storing it somewhere, then pushing it back in with load().

would you want to reuse that export on the same page?

You're right, probably not the best way to show the example by using the same data on the same page.

Maybe the better solution here would be to document how to access the underlying SQLite instance. I don’t think we want to create wrapper functions for everything that SQLite supports, especially if it’s not a use case we expect is common.

My thinking was "if there is a load(), there should be a matching save()" 🤷 Happy to go with accessing SQLite directly for things like this 👍

df-rw avatar Oct 14 '24 19:10 df-rw