import{logger as o}from"../../tools/notifiers/logger.js";import{envConfig as r}from"../../config/env-config.js";import{DatabaseConnectionFactory as i}from"./database-connection-factory.js";class e{static#e=!1;static async init(t){if(!(r.REDOCLY_INTERNAL_DEV||r.CI||r.isDevelopMode)&&!e.#e)try{await e.#t(t)==="PRECONNECTED"&&(e.#e=!0)}catch(a){o.error("Failed to preconnect to sqld remote database",a)}}static#t=async t=>await i.create({baseDbDir:t,databaseType:"remote"})?(o.info("Sqld remote database preconnected"),"PRECONNECTED"):(o.warn("Sqld remote database preconnect failed"),"NOT_PRECONNECTED")}export{e as DatabasePreconnectService};
