@nsshunt/stsfhirpg 1.2.39 → 1.2.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6952,6 +6952,30 @@ var PGFhirAccessLayer = class extends tiny_emitter.TinyEmitter {
6952
6952
  client.release();
6953
6953
  }
6954
6954
  };
6955
+ Vacuum = async () => {
6956
+ if (!this.#poolManager) {
6957
+ const errorMessage = `PGFhirAccessLayer:Vacuum(): poolManager not set`;
6958
+ this.#options.logger.error(errorMessage);
6959
+ throw new Error(errorMessage);
6960
+ }
6961
+ let client;
6962
+ try {
6963
+ client = await this.#poolManager.connectReadWrite();
6964
+ } catch (error) {
6965
+ const message = `PGFhirAccessLayer:Vacuum(): Connection Error: [${error}]`;
6966
+ this.#options.logger.error(message);
6967
+ throw new Error(message);
6968
+ }
6969
+ try {
6970
+ await client.query("VACUUM ANALYZE");
6971
+ } catch (error) {
6972
+ const message = `PGFhirAccessLayer:Vacuum(): Query Error: [${error}]`;
6973
+ this.#options.logger.error(message);
6974
+ throw new Error(message);
6975
+ } finally {
6976
+ client.release();
6977
+ }
6978
+ };
6955
6979
  };
6956
6980
  //#endregion
6957
6981
  exports.DBSearchIndex = DBSearchIndex;