@steroidsjs/nest 1.0.6 → 1.0.7

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.
@@ -1,23 +1,9 @@
1
1
  import { Connection } from 'typeorm';
2
- import { ConfigService } from '@nestjs/config';
3
- interface IMigrationData {
4
- moduleDir: string;
5
- modelName: string;
6
- tableName: string;
7
- upQueries: string[];
8
- downQueries: string[];
9
- }
10
2
  export declare class MigrateCommand {
11
- private configService;
12
3
  private connection;
13
- constructor(configService: ConfigService, connection: Connection);
4
+ constructor(connection: Connection);
14
5
  index(): Promise<void>;
15
6
  redo(): Promise<void>;
16
7
  show(): Promise<void>;
17
8
  generate(): Promise<void>;
18
- protected generateMigrations(moduleDir: any, modelPath: any, modelName: any, tableName: any): Promise<IMigrationData>;
19
- protected static queryParams(parameters: any[] | undefined): string;
20
- protected static prettifyQuery(query: string): string;
21
- protected static getTemplate(name: string, timestamp: number, upSqls: string[], downSqls: string[]): string;
22
9
  }
23
- export {};
@@ -8,22 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var MigrateCommand_1;
12
11
  Object.defineProperty(exports, "__esModule", { value: true });
13
12
  exports.MigrateCommand = void 0;
14
13
  const nestjs_command_1 = require("nestjs-command");
15
14
  const common_1 = require("@nestjs/common");
16
15
  const typeorm_1 = require("typeorm");
17
- const lodash = require("lodash");
18
- const path_1 = require("path");
19
- const fs = require("fs");
20
- const sqlFormatter_1 = require("@sqltools/formatter/lib/sqlFormatter");
21
- const config_1 = require("@nestjs/config");
22
- const load_configuration_1 = require("@nestjs/cli/lib/utils/load-configuration");
23
- const CommandUtils_1 = require("typeorm/commands/CommandUtils");
24
- let MigrateCommand = MigrateCommand_1 = class MigrateCommand {
25
- constructor(configService, connection) {
26
- this.configService = configService;
16
+ const generate_1 = require("./generate");
17
+ let MigrateCommand = class MigrateCommand {
18
+ constructor(connection) {
27
19
  this.connection = connection;
28
20
  }
29
21
  async index() {
@@ -40,105 +32,7 @@ let MigrateCommand = MigrateCommand_1 = class MigrateCommand {
40
32
  await this.connection.showMigrations();
41
33
  }
42
34
  async generate() {
43
- const modelsToTablesMap = this.connection.entityMetadatas.reduce((obj, entityMeta) => {
44
- obj[entityMeta.targetName] = entityMeta.tableName;
45
- return obj;
46
- });
47
- const cliConfiguration = await (0, load_configuration_1.loadConfiguration)();
48
- const sourceRoot = (0, path_1.join)(process.cwd(), cliConfiguration.sourceRoot);
49
- const migrationsDataList = [];
50
- const moduleDirs = fs.readdirSync(sourceRoot);
51
- for (const moduleName of moduleDirs) {
52
- if (fs.statSync((0, path_1.join)(sourceRoot, moduleName)).isDirectory()) {
53
- const moduleDir = (0, path_1.join)(sourceRoot, moduleName);
54
- const moduleClassPath = (0, path_1.join)(moduleDir, '/infrastructure/' + lodash.upperFirst(moduleName) + 'Module.ts');
55
- if (fs.existsSync(moduleClassPath)) {
56
- const modelsDir = (0, path_1.join)(sourceRoot, moduleName, 'infrastructure/tables');
57
- const modelFiles = fs.readdirSync(modelsDir);
58
- for (const modelFile of modelFiles) {
59
- const modelName = modelFile.replace(/\.ts$/, '');
60
- const modelPath = (0, path_1.join)(modelsDir, modelFile);
61
- const result = await this.generateMigrations(moduleDir, modelPath, modelName, modelsToTablesMap[modelName]);
62
- if (result) {
63
- migrationsDataList.push(result);
64
- }
65
- }
66
- }
67
- }
68
- }
69
- const timestamp = new Date().getTime();
70
- if (migrationsDataList.length === 0) {
71
- console.log('info', 'No changes in database schema were found');
72
- }
73
- else {
74
- console.log('info', 'Created migrations:');
75
- for (const migrationsData of migrationsDataList) {
76
- const fileContent = MigrateCommand_1.getTemplate(migrationsData.modelName, timestamp, migrationsData.upQueries, migrationsData.downQueries.reverse());
77
- const fileName = timestamp + '-' + migrationsData.modelName + '.ts';
78
- const path = (0, path_1.join)(migrationsData.moduleDir, '/infrastructure/migrations', fileName);
79
- console.log('info', '\t' + path);
80
- await CommandUtils_1.CommandUtils.createFile(path, fileContent);
81
- }
82
- }
83
- }
84
- async generateMigrations(moduleDir, modelPath, modelName, tableName) {
85
- const connection = new typeorm_1.Connection(Object.assign(Object.assign({}, this.configService.get('database')), { entities: [modelPath], synchronize: false, migrationsRun: false, dropSchema: false }));
86
- await connection.connect();
87
- const migrationData = {
88
- modelName,
89
- moduleDir,
90
- tableName,
91
- upQueries: [],
92
- downQueries: [],
93
- };
94
- try {
95
- const sqlInMemory = await connection.driver.createSchemaBuilder().log();
96
- for (const key of ['upQueries', 'downQueries']) {
97
- for (const query of sqlInMemory[key]) {
98
- query.query = MigrateCommand_1.prettifyQuery(query.query);
99
- query.query = query.query.replace(/`/g, '\\`');
100
- const params = MigrateCommand_1.queryParams(query.parameters);
101
- migrationData[key].push(' await queryRunner.query(`' + query.query + '`' + params + ');');
102
- }
103
- }
104
- }
105
- finally {
106
- await connection.close();
107
- }
108
- if (migrationData.upQueries.length === 0) {
109
- return null;
110
- }
111
- return migrationData;
112
- }
113
- static queryParams(parameters) {
114
- if (!parameters || !parameters.length) {
115
- return '';
116
- }
117
- return `, ${JSON.stringify(parameters)}`;
118
- }
119
- static prettifyQuery(query) {
120
- const formattedQuery = (0, sqlFormatter_1.format)(query, { indent: ' ' });
121
- return '\n' + formattedQuery.replace(/^/gm, ' ') + '\n ';
122
- }
123
- static getTemplate(name, timestamp, upSqls, downSqls) {
124
- const migrationName = `${name}${timestamp}`;
125
- return `import {MigrationInterface, QueryRunner} from 'typeorm';
126
-
127
- export class ${migrationName} implements MigrationInterface {
128
- name = '${migrationName}'
129
-
130
- public async up(queryRunner: QueryRunner): Promise<void> {
131
- ${upSqls.join(`
132
- `)}
133
- }
134
-
135
- public async down(queryRunner: QueryRunner): Promise<void> {
136
- ${downSqls.join(`
137
- `)}
138
- }
139
-
140
- }
141
- `;
35
+ await (0, generate_1.generate)(this.connection);
142
36
  }
143
37
  };
144
38
  __decorate([
@@ -177,10 +71,9 @@ __decorate([
177
71
  __metadata("design:paramtypes", []),
178
72
  __metadata("design:returntype", Promise)
179
73
  ], MigrateCommand.prototype, "generate", null);
180
- MigrateCommand = MigrateCommand_1 = __decorate([
74
+ MigrateCommand = __decorate([
181
75
  (0, common_1.Injectable)(),
182
- __metadata("design:paramtypes", [config_1.ConfigService,
183
- typeorm_1.Connection])
76
+ __metadata("design:paramtypes", [typeorm_1.Connection])
184
77
  ], MigrateCommand);
185
78
  exports.MigrateCommand = MigrateCommand;
186
79
  //# sourceMappingURL=MigrateCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MigrateCommand.js","sourceRoot":"","sources":["../../../src/infrastructure/commands/MigrateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAuC;AACvC,2CAA0C;AAC1C,qCAAmC;AACnC,iCAAiC;AACjC,+BAA0B;AAC1B,yBAAyB;AACzB,uEAA4D;AAC5D,2CAA6C;AAC7C,iFAA2E;AAC3E,gEAA2D;AAW3D,IAAa,cAAc,sBAA3B,MAAa,cAAc;IACvB,YACY,aAA4B,EAC5B,UAAsB;QADtB,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;IAElC,CAAC;IAMD,KAAK,CAAC,KAAK;QACP,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YAChC,WAAW,EAAE,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAMD,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;YACpC,WAAW,EAAE,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAMD,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IAC3C,CAAC;IAMD,KAAK,CAAC,QAAQ;QAEV,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,CAA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AC1C,qCAAmC;AACnC,yCAAoC;AAGpC,IAAa,cAAc,GAA3B,MAAa,cAAc;IACvB,YACY,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAElC,CAAC;IAMD,KAAK,CAAC,KAAK;QACP,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YAChC,WAAW,EAAE,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAMD,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;YACpC,WAAW,EAAE,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAMD,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IAC3C,CAAC;IAMD,KAAK,CAAC,QAAQ;QACV,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;CAEJ,CAAA;AAhCG;IAJC,IAAA,wBAAO,EAAC;QACL,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,gBAAgB;KAC7B,CAAC;;;;2CAKD;AAMD;IAJC,IAAA,wBAAO,EAAC;QACL,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,uBAAuB;KACpC,CAAC;;;;0CAKD;AAMD;IAJC,IAAA,wBAAO,EAAC;QACL,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,sBAAsB;KACnC,CAAC;;;;0CAGD;AAMD;IAJC,IAAA,wBAAO,EAAC;QACL,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,0CAA0C;KACvD,CAAC;;;;8CAGD;AAxCQ,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGe,oBAAU;GAFzB,cAAc,CA0C1B;AA1CY,wCAAc"}
@@ -0,0 +1,45 @@
1
+ import { QueryRunner } from 'typeorm/query-runner/QueryRunner';
2
+ import { Table } from 'typeorm/schema-builder/table/Table';
3
+ import { TableCheck } from 'typeorm/schema-builder/table/TableCheck';
4
+ import { TableColumn } from 'typeorm/schema-builder/table/TableColumn';
5
+ import { TableExclusion } from 'typeorm/schema-builder/table/TableExclusion';
6
+ import { TableForeignKey } from 'typeorm/schema-builder/table/TableForeignKey';
7
+ import { TableIndex } from 'typeorm/schema-builder/table/TableIndex';
8
+ import { TableUnique } from 'typeorm/schema-builder/table/TableUnique';
9
+ import { Query } from 'typeorm/driver/Query';
10
+ import { PostgresQueryRunner } from 'typeorm/driver/postgres/PostgresQueryRunner';
11
+ import { SqlInMemory } from 'typeorm/driver/SqlInMemory';
12
+ export declare class TableQuery {
13
+ tableName: string;
14
+ query: Query;
15
+ constructor(tableName: string, query: Query);
16
+ }
17
+ export declare class TableSqlInMemory extends SqlInMemory {
18
+ upTableQueries: TableQuery[];
19
+ downTableQueries: TableQuery[];
20
+ }
21
+ export declare class CustomPostgresQueryRunner extends PostgresQueryRunner implements QueryRunner {
22
+ protected sqlInMemory: TableSqlInMemory;
23
+ createTable(table: Table, ifNotExist?: boolean, createForeignKeys?: boolean, createIndices?: boolean): Promise<void>;
24
+ dropTable(target: Table | string, ifExist?: boolean, dropForeignKeys?: boolean, dropIndices?: boolean): Promise<void>;
25
+ addColumn(tableOrName: Table | string, column: TableColumn): Promise<void>;
26
+ renameColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newTableColumnOrName: TableColumn | string): Promise<void>;
27
+ changeColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newColumn: TableColumn): Promise<void>;
28
+ dropColumn(tableOrName: Table | string, columnOrName: TableColumn | string): Promise<void>;
29
+ updatePrimaryKeys(tableOrName: Table | string, columns: TableColumn[]): Promise<void>;
30
+ createUniqueConstraint(tableOrName: Table | string, uniqueConstraint: TableUnique): Promise<void>;
31
+ dropUniqueConstraint(tableOrName: Table | string, uniqueOrName: TableUnique | string): Promise<void>;
32
+ createCheckConstraint(tableOrName: Table | string, checkConstraint: TableCheck): Promise<void>;
33
+ dropCheckConstraint(tableOrName: Table | string, checkOrName: TableCheck | string): Promise<void>;
34
+ createExclusionConstraint(tableOrName: Table | string, exclusionConstraint: TableExclusion): Promise<void>;
35
+ dropExclusionConstraint(tableOrName: Table | string, exclusionOrName: TableExclusion | string): Promise<void>;
36
+ createForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void>;
37
+ dropForeignKey(tableOrName: Table | string, foreignKeyOrName: TableForeignKey | string): Promise<void>;
38
+ createIndex(tableOrName: Table | string, index: TableIndex): Promise<void>;
39
+ dropIndex(tableOrName: Table | string, indexOrName: TableIndex | string): Promise<void>;
40
+ protected executeQueries(upQueries: TableQuery | TableQuery[] | Query | Query[], downQueries: TableQuery | TableQuery[] | Query | Query[]): Promise<void>;
41
+ enableSqlMemory(): void;
42
+ disableSqlMemory(): void;
43
+ clearSqlMemory(): void;
44
+ getMemorySql(): TableSqlInMemory;
45
+ }