Open pmp-p opened 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.
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.