pmp-p / pglite-16.x

16.x CI build test
https://pmp-p.github.io/pglite-16.x/
Apache License 2.0
0 stars 1 forks source link

async init #4

Open pmp-p opened 3 months ago

pmp-p commented 3 months ago

the async #init(options: PGliteOptions) portion should be splitted this way:

-> a (almost) synchronous part (may be speed up by html preloading the file list) which ready the wasm module.

-> database engine is ready, MEMFS is ready

-> begin to init secondary FS ( ie FS mounted inside the MEMFS) maybe async.

-> fetch external ressources that may be required to init db VS current status of filesystem.

-> wait for init secondary FS to be completed, and all external resolved

-> populate/restore FS

-> initdb.

-> set ready for query (by resolving the promise).

error reporting in these stages should be accessible to end user, because connectivity/credentials.