import { crossPlatformPath, dotTaonFolder, path, Helpers__NS__exists, Helpers__NS__mkdirp, UtilsOs__NS__getRealHomeDir } from 'tnp-core/lib-prod';
/**
 * Get taon service database config
 * (database is stored in user's home directory)
 * @param serviceNameUniqueInSystem - unique name of the service in the system
 * @param recreateMode - mode of database recreation, default is 'DROP_DB+MIGRATIONS'
 * @returns DatabaseConfig object with location and recreateMode
 */
export const getBaseCliWorkerDatabaseConfig = (serviceNameUniqueInSystem, recreateMode = 'DROP_DB+MIGRATIONS') => {
    //#region @backendFunc
    const serviceLocation = crossPlatformPath([
        UtilsOs__NS__getRealHomeDir(),
        `${dotTaonFolder}/databases-for-services/${serviceNameUniqueInSystem}.sqlite`,
    ]);
    if (!Helpers__NS__exists(path.dirname(serviceLocation))) {
        Helpers__NS__mkdirp(path.dirname(serviceLocation));
    }
    // console.log('portsWorkerDatabaseLocation', portsWorkerDatabaseLocation);
    return {
        database: {
            recreateMode,
            location: serviceLocation,
        },
    };
    //#endregion
};
//# sourceMappingURL=c:/Users/darek/projects/npm/taon-dev/tnp-helpers/dist-nocutsrc-prod/lib/base/classes/base-cli-worker/base-cli-worker-database-config.js.map