rucken
Version:
Console tools and scripts for nx and not only that I (EndyKaufman) use to automate the workflow and speed up the development process
55 lines (54 loc) • 2.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostgresCommands = void 0;
const tslib_1 = require("tslib");
const nestjs_console_1 = require("../../nestjs-console");
const utils_service_1 = require("../utils/utils.service");
const postgres_config_1 = require("./postgres.config");
let PostgresCommands = class PostgresCommands {
constructor(utilsService) {
this.utilsService = utilsService;
this.postgresConfig = this.utilsService.getRuckenConfig(postgres_config_1.DEFAULT_POSTGRES_CONFIG).postgres;
}
postgres({ rootDatabaseUrl, appDatabaseUrl, forceChangeUsername, forceChangePassword, dropAppDatabase, }) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
throw new Error('The postgres application database creator has been moved to the project https://github.com/EndyKaufman/pg-tools and is published as a console utility https://www.npmjs.com/package/pg-create-db');
});
}
};
tslib_1.__decorate([
(0, nestjs_console_1.Command)({
command: 'postgres',
description: 'postgres application database creator',
options: [
{
flags: '-r,--root-database-url [strings]',
description: 'database url for connect as root user (example: postgres://ROOT_POSTGRES_USER:ROOT_POSTGRES_PASSWORD@localhost:POSTGRES_PORT/postgres?schema=public)',
},
{
flags: '-a,--app-database-url [strings]',
description: 'application database url used for create new database (example: postgres://POSTGRES_USER:POSTGRES_PASSWORD@localhost:POSTGRES_PORT/POSTGRES_DATABASE?schema=public)',
},
{
flags: '-fu,--force-change-username [boolean]',
description: 'force rename username if one exists in database for app-database-url excluding root (default: false)',
},
{
flags: '-fp,--force-change-password [boolean]',
description: 'force change password of specified app-database-url (default: false)',
},
{
flags: '-d,--drop-app-database [boolean]',
description: 'drop application database before try create it (default: false)',
},
],
}),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Object]),
tslib_1.__metadata("design:returntype", Promise)
], PostgresCommands.prototype, "postgres", null);
PostgresCommands = tslib_1.__decorate([
(0, nestjs_console_1.Console)(),
tslib_1.__metadata("design:paramtypes", [utils_service_1.UtilsService])
], PostgresCommands);
exports.PostgresCommands = PostgresCommands;