X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fbase.js;h=8d72d0fb88e2c63fa42e0a09773329147b86382e;hb=4f64b8910e1295207a42c757cb81c9b0e9ee3be2;hp=8a1df74b9bfb344d1457fa4ff3e9df932b27b6c0;hpb=6013420158d848f6411a7210585d107191fc5ee7;p=websub-hub diff --git a/src/db/base.js b/src/db/base.js index 8a1df74..8d72d0f 100644 --- a/src/db/base.js +++ b/src/db/base.js @@ -83,14 +83,14 @@ class Database { /** - * Validate schema compatibility. - * Ensure this is called immediately after instantiating a DB instance, - * as some engines also finish initialization and validation here, which - * was easier than wrangling async calls in constructor. - * In light of this behavior, this method could be named better. - */ - async schemaCheck() { - const _scope = _fileScope('schemaCheck'); + * Perform tasks needed to prepare database for use. Ensure this is called + * after construction, and before any other database activity. + * At the minimum, this will validate a compatible schema is present and usable. + * Some engines will also perform other initializations or async actions which + * are easier handled outside the constructor. + */ + async initialize() { + const _scope = _fileScope('initialize'); const currentSchema = await this._currentSchema(); const current = svh.schemaVersionObjectToNumber(currentSchema);