@nsshunt/stsfhirpg 1.2.38 → 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.mjs CHANGED
@@ -6925,6 +6925,30 @@ var PGFhirAccessLayer = class extends TinyEmitter {
6925
6925
  client.release();
6926
6926
  }
6927
6927
  };
6928
+ Vacuum = async () => {
6929
+ if (!this.#poolManager) {
6930
+ const errorMessage = `PGFhirAccessLayer:Vacuum(): poolManager not set`;
6931
+ this.#options.logger.error(errorMessage);
6932
+ throw new Error(errorMessage);
6933
+ }
6934
+ let client;
6935
+ try {
6936
+ client = await this.#poolManager.connectReadWrite();
6937
+ } catch (error) {
6938
+ const message = `PGFhirAccessLayer:Vacuum(): Connection Error: [${error}]`;
6939
+ this.#options.logger.error(message);
6940
+ throw new Error(message);
6941
+ }
6942
+ try {
6943
+ await client.query("VACUUM ANALYZE");
6944
+ } catch (error) {
6945
+ const message = `PGFhirAccessLayer:Vacuum(): Query Error: [${error}]`;
6946
+ this.#options.logger.error(message);
6947
+ throw new Error(message);
6948
+ } finally {
6949
+ client.release();
6950
+ }
6951
+ };
6928
6952
  };
6929
6953
  //#endregion
6930
6954
  export { DBSearchIndex, FHIRDateUtils, PGFhirAccessLayer, ResourceHelper, hashReferenceParam, hashStringParam, hashTokenParam, hashUriParam, initHash, normalizeStringParam, xxhash64Signed };