Showing 20 of 35 files from the diff.

@@ -1,8 +1,8 @@
Loading
1 -
import { Connection } from "../connection/Connection";
2 -
import { SchemaBuilder } from "./SchemaBuilder";
3 -
import { MongoDriver } from "../driver/mongodb/MongoDriver";
4 -
import { SqlInMemory } from "../driver/SqlInMemory";
5 -
import { MongodbIndexOptions } from "../driver/mongodb/typings";
1 +
import {Connection} from "../connection/Connection";
2 +
import {SchemaBuilder} from "./SchemaBuilder";
3 +
import {MongoDriver} from "../driver/mongodb/MongoDriver";
4 +
import {SqlInMemory} from "../driver/SqlInMemory";
5 +
import {MongodbIndexOptions} from "../driver/mongodb/typings";
6 6
7 7
/**
8 8
 * Creates complete tables schemas in the database based on the entity metadatas.

@@ -1,4 +1,4 @@
Loading
1 -
import { ObjectUtils } from "../util/ObjectUtils";
1 +
import {ObjectUtils} from "../util/ObjectUtils";
2 2
3 3
/**
4 4
 * Thrown when query execution has failed.
@@ -20,4 +20,4 @@
Loading
20 20
        });
21 21
    }
22 22
23 -
}

@@ -1,5 +1,4 @@
Loading
1 -
import {Connection, Driver, SelectQueryBuilder} from "../..";
2 -
import {EntityMetadata} from "../..";
1 +
import {Connection, Driver, EntityMetadata, SelectQueryBuilder} from "../..";
3 2
import {ViewOptions} from "../options/ViewOptions";
4 3
5 4
/**

@@ -255,7 +255,6 @@
Loading
255 255
                return idMap;
256 256
            }).filter(result => result);
257 257
258 -
259 258
            const properties = rawRelationIdResult.relationIdAttribute.mapToPropertyPropertyPath.split(".");
260 259
            const mapToProperty = (properties: string[], map: ObjectLiteral, value: any): any => {
261 260

@@ -1,4 +1,4 @@
Loading
1 -
import { ValueTransformer } from "../decorator/options/ValueTransformer";
1 +
import {ValueTransformer} from "../decorator/options/ValueTransformer";
2 2
3 3
export class ApplyValueTransformers {
4 4
    static transformFrom(transformer: ValueTransformer | ValueTransformer[], databaseValue: any) {
@@ -18,4 +18,4 @@
Loading
18 18
        }
19 19
        return transformer.to(entityValue);
20 20
    }
21 -
}

@@ -2,7 +2,7 @@
Loading
2 2
import {ColumnTypeUndefinedError} from "../../error/ColumnTypeUndefinedError";
3 3
import {PrimaryColumnCannotBeNullableError} from "../../error/PrimaryColumnCannotBeNullableError";
4 4
import {ColumnMetadataArgs} from "../../metadata-args/ColumnMetadataArgs";
5 -
import { GeneratedMetadataArgs } from "../../metadata-args/GeneratedMetadataArgs";
5 +
import {GeneratedMetadataArgs} from "../../metadata-args/GeneratedMetadataArgs";
6 6
7 7
/**
8 8
 * Column decorator is used to mark a specific class property as a table column.

@@ -1,7 +1,11 @@
Loading
1 1
import {ColumnOptions, getMetadataArgsStorage} from "../../";
2 2
import {
3 -
    ColumnType, SimpleColumnType, SpatialColumnType, WithLengthColumnType,
4 -
    WithPrecisionColumnType, WithWidthColumnType
3 +
    ColumnType,
4 +
    SimpleColumnType,
5 +
    SpatialColumnType,
6 +
    WithLengthColumnType,
7 +
    WithPrecisionColumnType,
8 +
    WithWidthColumnType
5 9
} from "../../driver/types/ColumnTypes";
6 10
import {ColumnMetadataArgs} from "../../metadata-args/ColumnMetadataArgs";
7 11
import {ColumnCommonOptions} from "../options/ColumnCommonOptions";
@@ -14,7 +18,7 @@
Loading
14 18
import {ColumnTypeUndefinedError} from "../../error/ColumnTypeUndefinedError";
15 19
import {ColumnHstoreOptions} from "../options/ColumnHstoreOptions";
16 20
import {ColumnWithWidthOptions} from "../options/ColumnWithWidthOptions";
17 -
import { GeneratedMetadataArgs } from "../../metadata-args/GeneratedMetadataArgs";
21 +
import {GeneratedMetadataArgs} from "../../metadata-args/GeneratedMetadataArgs";
18 22
19 23
/**
20 24
 * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this

@@ -1,5 +1,5 @@
Loading
1 1
import {EntityMetadata} from "../metadata/EntityMetadata";
2 -
import { ObjectUtils } from "../util/ObjectUtils";
2 +
import {ObjectUtils} from "../util/ObjectUtils";
3 3
4 4
/**
5 5
 */
@@ -45,4 +45,4 @@
Loading
45 45
        return this._metadata;
46 46
    }
47 47
48 -
}

@@ -2,6 +2,7 @@
Loading
2 2
import * as fs from "fs";
3 3
import chalk from "chalk";
4 4
import {highlight, Theme} from "cli-highlight";
5 +
5 6
export {ReadStream} from "fs";
6 7
export {EventEmitter} from "events";
7 8
export {Readable, Writable} from "stream";

@@ -1,4 +1,4 @@
Loading
1 -
import { ObjectLiteral } from "../common/ObjectLiteral";
1 +
import {ObjectLiteral} from "../common/ObjectLiteral";
2 2
3 3
export class OrmUtils {
4 4

@@ -8,8 +8,8 @@
Loading
8 8
import {MssqlParameter} from "../driver/sqlserver/MssqlParameter";
9 9
import {SqlServerConnectionOptions} from "../driver/sqlserver/SqlServerConnectionOptions";
10 10
import {PostgresConnectionOptions} from "../driver/postgres/PostgresConnectionOptions";
11 -
import { MongoDriver } from "../driver/mongodb/MongoDriver";
12 -
import { MongoQueryRunner } from "../driver/mongodb/MongoQueryRunner";
11 +
import {MongoDriver} from "../driver/mongodb/MongoDriver";
12 +
import {MongoQueryRunner} from "../driver/mongodb/MongoQueryRunner";
13 13
14 14
/**
15 15
 * Executes migrations: runs pending and reverts previously executed migrations.

@@ -392,7 +392,7 @@
Loading
392 392
            return columnMetadata.transformer ? ApplyValueTransformers.transformFrom(columnMetadata.transformer, value) : value;
393 393
394 394
        if (columnMetadata.type === Boolean) {
395 -
            value = value ? true : false;
395 +
            value = !!value;
396 396
397 397
        } else if (columnMetadata.type === "date") {
398 398
            value = DateUtils.mixedDateToDateString(value);

@@ -1,4 +1,4 @@
Loading
1 -
import { ColumnMetadata } from "../metadata/ColumnMetadata";
1 +
import {ColumnMetadata} from "../metadata/ColumnMetadata";
2 2
3 3
/**
4 4
 * Provides utilities to transform hydrated and persisted data.

@@ -1,9 +1,9 @@
Loading
1 -
import { QueryRunner } from "../../query-runner/QueryRunner";
2 -
import { ObjectLiteral } from "../../common/ObjectLiteral";
3 -
import { TableColumn } from "../../schema-builder/table/TableColumn";
4 -
import { Table } from "../../schema-builder/table/Table";
5 -
import { TableForeignKey } from "../../schema-builder/table/TableForeignKey";
6 -
import { TableIndex } from "../../schema-builder/table/TableIndex";
1 +
import {QueryRunner} from "../../query-runner/QueryRunner";
2 +
import {ObjectLiteral} from "../../common/ObjectLiteral";
3 +
import {TableColumn} from "../../schema-builder/table/TableColumn";
4 +
import {Table} from "../../schema-builder/table/Table";
5 +
import {TableForeignKey} from "../../schema-builder/table/TableForeignKey";
6 +
import {TableIndex} from "../../schema-builder/table/TableIndex";
7 7
import {View} from "../../schema-builder/view/View";
8 8
import {
9 9
    AggregationCursor,
@@ -38,14 +38,14 @@
Loading
38 38
    UnorderedBulkOperation,
39 39
    UpdateWriteOpResult
40 40
} from "./typings";
41 -
import { Connection } from "../../connection/Connection";
42 -
import { ReadStream } from "../../platform/PlatformTools";
43 -
import { MongoEntityManager } from "../../entity-manager/MongoEntityManager";
44 -
import { SqlInMemory } from "../SqlInMemory";
45 -
import { TableUnique } from "../../schema-builder/table/TableUnique";
46 -
import { Broadcaster } from "../../subscriber/Broadcaster";
47 -
import { TableCheck } from "../../schema-builder/table/TableCheck";
48 -
import { TableExclusion } from "../../schema-builder/table/TableExclusion";
41 +
import {Connection} from "../../connection/Connection";
42 +
import {ReadStream} from "../../platform/PlatformTools";
43 +
import {MongoEntityManager} from "../../entity-manager/MongoEntityManager";
44 +
import {SqlInMemory} from "../SqlInMemory";
45 +
import {TableUnique} from "../../schema-builder/table/TableUnique";
46 +
import {Broadcaster} from "../../subscriber/Broadcaster";
47 +
import {TableCheck} from "../../schema-builder/table/TableCheck";
48 +
import {TableExclusion} from "../../schema-builder/table/TableExclusion";
49 49
50 50
/**
51 51
 * Runs queries on a single MongoDB connection.

@@ -92,7 +92,7 @@
Loading
92 92
                    downQuery.query = MigrationGenerateCommand.prettifyQuery(downQuery.query);
93 93
                });
94 94
            }
95 -
            
95 +
96 96
            const upSqls: string[] = [], downSqls: string[] = [];
97 97
98 98
            // mysql is exceptional here because it uses ` character in to escape names in queries, that's why for mysql
@@ -178,7 +178,7 @@
Loading
178 178
    }
179 179
180 180
    /**
181 -
     * 
181 +
     *
182 182
     */
183 183
    protected static prettifyQuery(query: string) {
184 184
        const formattedQuery = format(query, { indent: "    " });

@@ -1,4 +1,4 @@
Loading
1 -
import { EventEmitter, Readable, Writable } from "../../platform/PlatformTools";
1 +
import {EventEmitter, Readable, Writable} from "../../platform/PlatformTools";
2 2
3 3
/**
4 4
 * Creates a new MongoClient instance.
@@ -5014,7 +5014,7 @@
Loading
5014 5014
     * @see http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#forEach
5015 5015
     */
5016 5016
    forEach(iterator: IteratorCallback<T>, callback: EndCallback): void;
5017 -
    forEach(iterator: IteratorCallback<T>): Promise<void>;    
5017 +
    forEach(iterator: IteratorCallback<T>): Promise<void>;
5018 5018
5019 5019
    /**
5020 5020
     * Check if there is any document still available in the cursor.

@@ -21,7 +21,7 @@
Loading
21 21
import {TableCheck} from "../../schema-builder/table/TableCheck";
22 22
import {IsolationLevel} from "../types/IsolationLevel";
23 23
import {TableExclusion} from "../../schema-builder/table/TableExclusion";
24 -
import { VersionUtils } from "../../util/VersionUtils";
24 +
import {VersionUtils} from "../../util/VersionUtils";
25 25
26 26
/**
27 27
 * Runs queries on a single mysql database connection.

@@ -1,6 +1,6 @@
Loading
1 -
import { getMetadataArgsStorage } from "../";
2 -
import { EntityRepositoryMetadataArgs } from "../metadata-args/EntityRepositoryMetadataArgs";
3 -
import { EntitySchema } from "../entity-schema/EntitySchema";
1 +
import {getMetadataArgsStorage} from "../";
2 +
import {EntityRepositoryMetadataArgs} from "../metadata-args/EntityRepositoryMetadataArgs";
3 +
import {EntitySchema} from "../entity-schema/EntitySchema";
4 4
5 5
/**
6 6
 * Used to declare a class as a custom repository.

@@ -24,7 +24,8 @@
Loading
24 24
    InsertWriteOpResult,
25 25
    MapReduceOptions,
26 26
    MongoCountPreferences,
27 -
    MongodbIndexOptions, ObjectID,
27 +
    MongodbIndexOptions,
28 +
    ObjectID,
28 29
    OrderedBulkOperation,
29 30
    ParallelCollectionScanOptions,
30 31
    ReadPreference,
@@ -357,4 +358,4 @@
Loading
357 358
        return this.manager.updateOne(this.metadata.tableName, query, update, options);
358 359
    }
359 360
360 -
}

@@ -1,7 +1,7 @@
Loading
1 -
import { Driver } from "./Driver";
1 +
import {Driver} from "./Driver";
2 2
import { hash } from "../util/StringUtils";
3 3
4 -
    /**
4 +
/**
5 5
 * Common driver utility functions.
6 6
 */
7 7
export class DriverUtils {
Files Coverage
src 74.46%
Project Totals (294 files) 74.46%
2863
Build #2863 -
2861
Build #2861 -
2864
Build #2864 -
1
coverage:
2
  precision: 2
3
  round: down
4
  range: "40...80"
5

6
comment: off
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading