Comparing version 0.3.20-dev.c22e30f to 0.3.20-dev.f232ba7
@@ -73,2 +73,4 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
"urowid", | ||
"simple-json", | ||
"json", | ||
]; | ||
@@ -219,4 +221,4 @@ /** | ||
async connect() { | ||
this.oracle.fetchAsString = [this.oracle.CLOB]; | ||
this.oracle.fetchAsBuffer = [this.oracle.BLOB]; | ||
this.oracle.fetchAsString = [this.oracle.DB_TYPE_CLOB]; | ||
this.oracle.fetchAsBuffer = [this.oracle.DB_TYPE_BLOB]; | ||
if (this.options.replication) { | ||
@@ -412,2 +414,5 @@ this.slaves = await Promise.all(this.options.replication.slaves.map((slave) => { | ||
} | ||
else if (columnMetadata.type === "json") { | ||
return DateUtils.simpleJsonToString(value); | ||
} | ||
return value; | ||
@@ -438,5 +443,2 @@ } | ||
} | ||
else if (columnMetadata.type === "json") { | ||
value = JSON.parse(value); | ||
} | ||
else if (columnMetadata.type === "simple-array") { | ||
@@ -492,2 +494,5 @@ value = DateUtils.stringToSimpleArray(value); | ||
} | ||
else if (column.type === "json") { | ||
return "json"; | ||
} | ||
else { | ||
@@ -772,3 +777,3 @@ return column.type || ""; | ||
case "decimal": | ||
return this.oracle.NUMBER; | ||
return this.oracle.DB_TYPE_NUMBER; | ||
case "char": | ||
@@ -778,7 +783,8 @@ case "nchar": | ||
case "varchar2": | ||
return this.oracle.STRING; | ||
return this.oracle.DB_TYPE_VARCHAR; | ||
case "blob": | ||
return this.oracle.BLOB; | ||
return this.oracle.DB_TYPE_BLOB; | ||
case "simple-json": | ||
case "clob": | ||
return this.oracle.CLOB; | ||
return this.oracle.DB_TYPE_CLOB; | ||
case "date": | ||
@@ -788,3 +794,5 @@ case "timestamp": | ||
case "timestamp with local time zone": | ||
return this.oracle.DATE; | ||
return this.oracle.DB_TYPE_TIMESTAMP; | ||
case "json": | ||
return this.oracle.DB_TYPE_JSON; | ||
} | ||
@@ -791,0 +799,0 @@ } |
@@ -418,3 +418,3 @@ | ||
*/ | ||
changeTableComment(tableOrName: Table | string, comment?: string): Promise<void>; | ||
changeTableComment(tableOrName: Table | string, newComment?: string): Promise<void>; | ||
} |
@@ -464,6 +464,2 @@ import { OrmUtils } from "../util/OrmUtils"; | ||
} | ||
else if (embeddedObject === null) { | ||
// when embedded object is null, set all its properties to null | ||
value = null; | ||
} | ||
} | ||
@@ -470,0 +466,0 @@ else { |
@@ -419,6 +419,2 @@ import { CannotCreateEntityIdMapError } from "../error/CannotCreateEntityIdMapError"; | ||
return relation.joinColumns; | ||
// try to find a relation with a property path being an embedded entity | ||
const embedded = this.findEmbeddedWithPropertyPath(propertyPath); | ||
if (embedded) | ||
return embedded.columns; | ||
return []; | ||
@@ -683,2 +679,3 @@ } | ||
return (column.default !== undefined || | ||
column.asExpression !== undefined || | ||
column.isGenerated || | ||
@@ -685,0 +682,0 @@ column.isCreateDate || |
@@ -282,3 +282,4 @@ import { v4 as uuidv4 } from "uuid"; | ||
if (valuesExpression) { | ||
if (this.connection.driver.options.type === "oracle" && | ||
if ((this.connection.driver.options.type === "oracle" || | ||
this.connection.driver.options.type === "sap") && | ||
this.getValueSets().length > 1) { | ||
@@ -285,0 +286,0 @@ query += ` ${valuesExpression}`; |
@@ -149,3 +149,5 @@ import { TypeORMError } from "../error"; | ||
return this.expressionMap.mainAlias.metadata.columns.filter((column) => { | ||
return column.isUpdateDate || column.isVersion; | ||
return (column.asExpression !== undefined || | ||
column.isUpdateDate || | ||
column.isVersion); | ||
}); | ||
@@ -158,3 +160,4 @@ } | ||
return this.expressionMap.mainAlias.metadata.columns.filter((column) => { | ||
return (column.isUpdateDate || | ||
return (column.asExpression !== undefined || | ||
column.isUpdateDate || | ||
column.isVersion || | ||
@@ -161,0 +164,0 @@ column.isDeleteDate); |
@@ -507,13 +507,13 @@ | ||
/** | ||
* Set's LIMIT - maximum number of rows to be selected. | ||
* Sets LIMIT - maximum number of rows to be selected. | ||
* NOTE that it may not work as you expect if you are using joins. | ||
* If you want to implement pagination, and you are having join in your query, | ||
* then use instead take method instead. | ||
* then use the take method instead. | ||
*/ | ||
limit(limit?: number): this; | ||
/** | ||
* Set's OFFSET - selection offset. | ||
* Sets OFFSET - selection offset. | ||
* NOTE that it may not work as you expect if you are using joins. | ||
* If you want to implement pagination, and you are having join in your query, | ||
* then use instead skip method instead. | ||
* then use the skip method instead. | ||
*/ | ||
@@ -520,0 +520,0 @@ offset(offset?: number): this; |
@@ -40,11 +40,2 @@ import { Driver } from "../../driver/Driver"; | ||
/** | ||
* Returns whether an object is an iterrable | ||
* This is useful when trying to avoid objects such as Dates | ||
*/ | ||
private isIterrableObject; | ||
/** | ||
* Deeply nullify an object if all its properties values are null or undefined | ||
*/ | ||
private deeplyNullify; | ||
/** | ||
* Transforms joined entities in the given raw results by a given alias and stores to the given (parent) entity | ||
@@ -51,0 +42,0 @@ */ |
@@ -134,33 +134,5 @@ import { OrmUtils } from "../../util/OrmUtils"; | ||
}); | ||
// Set all embedded column values to null if all their child columns are null | ||
if (entity) { | ||
metadata.embeddeds.forEach((embedded) => { | ||
if (embedded.propertyName in entity) { | ||
entity[embedded.propertyName] = this.deeplyNullify(entity[embedded.propertyName]); | ||
} | ||
}); | ||
} | ||
return hasData; | ||
} | ||
/** | ||
* Returns whether an object is an iterrable | ||
* This is useful when trying to avoid objects such as Dates | ||
*/ | ||
isIterrableObject(obj) { | ||
const prototype = Object.prototype.toString.call(obj); | ||
return prototype === "[object Object]" || prototype === "[object Array]"; | ||
} | ||
/** | ||
* Deeply nullify an object if all its properties values are null or undefined | ||
*/ | ||
deeplyNullify(obj) { | ||
if (!this.isIterrableObject(obj)) | ||
return obj; | ||
for (const key in obj) { | ||
obj[key] = this.deeplyNullify(obj[key]); | ||
} | ||
const nullify = Object.values(obj).every((value) => value == null); | ||
return nullify ? null : obj; | ||
} | ||
/** | ||
* Transforms joined entities in the given raw results by a given alias and stores to the given (parent) entity | ||
@@ -167,0 +139,0 @@ */ |
@@ -394,3 +394,4 @@ import { Table } from "./table/Table"; | ||
continue; | ||
if (DriverUtils.isMySQLFamily(this.connection.driver)) { | ||
if (DriverUtils.isMySQLFamily(this.connection.driver) || | ||
this.connection.driver.options.type === 'postgres') { | ||
const newComment = metadata.comment; | ||
@@ -397,0 +398,0 @@ await this.queryRunner.changeTableComment(table, newComment); |
@@ -76,2 +76,4 @@ "use strict"; | ||
"urowid", | ||
"simple-json", | ||
"json", | ||
]; | ||
@@ -222,4 +224,4 @@ /** | ||
async connect() { | ||
this.oracle.fetchAsString = [this.oracle.CLOB]; | ||
this.oracle.fetchAsBuffer = [this.oracle.BLOB]; | ||
this.oracle.fetchAsString = [this.oracle.DB_TYPE_CLOB]; | ||
this.oracle.fetchAsBuffer = [this.oracle.DB_TYPE_BLOB]; | ||
if (this.options.replication) { | ||
@@ -415,2 +417,5 @@ this.slaves = await Promise.all(this.options.replication.slaves.map((slave) => { | ||
} | ||
else if (columnMetadata.type === "json") { | ||
return DateUtils_1.DateUtils.simpleJsonToString(value); | ||
} | ||
return value; | ||
@@ -441,5 +446,2 @@ } | ||
} | ||
else if (columnMetadata.type === "json") { | ||
value = JSON.parse(value); | ||
} | ||
else if (columnMetadata.type === "simple-array") { | ||
@@ -495,2 +497,5 @@ value = DateUtils_1.DateUtils.stringToSimpleArray(value); | ||
} | ||
else if (column.type === "json") { | ||
return "json"; | ||
} | ||
else { | ||
@@ -775,3 +780,3 @@ return column.type || ""; | ||
case "decimal": | ||
return this.oracle.NUMBER; | ||
return this.oracle.DB_TYPE_NUMBER; | ||
case "char": | ||
@@ -781,7 +786,8 @@ case "nchar": | ||
case "varchar2": | ||
return this.oracle.STRING; | ||
return this.oracle.DB_TYPE_VARCHAR; | ||
case "blob": | ||
return this.oracle.BLOB; | ||
return this.oracle.DB_TYPE_BLOB; | ||
case "simple-json": | ||
case "clob": | ||
return this.oracle.CLOB; | ||
return this.oracle.DB_TYPE_CLOB; | ||
case "date": | ||
@@ -791,3 +797,5 @@ case "timestamp": | ||
case "timestamp with local time zone": | ||
return this.oracle.DATE; | ||
return this.oracle.DB_TYPE_TIMESTAMP; | ||
case "json": | ||
return this.oracle.DB_TYPE_JSON; | ||
} | ||
@@ -794,0 +802,0 @@ } |
@@ -418,3 +418,3 @@ | ||
*/ | ||
changeTableComment(tableOrName: Table | string, comment?: string): Promise<void>; | ||
changeTableComment(tableOrName: Table | string, newComment?: string): Promise<void>; | ||
} |
@@ -467,6 +467,2 @@ "use strict"; | ||
} | ||
else if (embeddedObject === null) { | ||
// when embedded object is null, set all its properties to null | ||
value = null; | ||
} | ||
} | ||
@@ -473,0 +469,0 @@ else { |
@@ -422,6 +422,2 @@ "use strict"; | ||
return relation.joinColumns; | ||
// try to find a relation with a property path being an embedded entity | ||
const embedded = this.findEmbeddedWithPropertyPath(propertyPath); | ||
if (embedded) | ||
return embedded.columns; | ||
return []; | ||
@@ -686,2 +682,3 @@ } | ||
return (column.default !== undefined || | ||
column.asExpression !== undefined || | ||
column.isGenerated || | ||
@@ -688,0 +685,0 @@ column.isCreateDate || |
@@ -1,1 +0,1 @@ | ||
{ "name": "typeorm", "private": false, "version": "0.3.20-dev.c22e30f", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">=16.13.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@tsconfig/node16": "^16.1.1", "@types/app-root-path": "^1.2.4", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/debug": "^4.1.7", "@types/gulp-rename": "^2.0.6", "@types/gulp-sourcemaps": "^0.0.38", "@types/mkdirp": "^1.0.2", "@types/mocha": "^10.0.1", "@types/node": "^18.13.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^10.0.13", "@types/source-map-support": "^0.5.6", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.22", "@typescript-eslint/eslint-plugin": "^6.17.0", "better-sqlite3": "^8.1.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^5.0.13", "conventional-changelog-cli": "^2.2.2", "del": "6.1.1", "eslint": "^8.44.0", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^10.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^8.0.3", "mocha": "^10.2.0", "mongodb": "^6.3.0", "mssql": "^10.0.1", "mysql": "^2.18.1", "mysql2": "^3.1.1", "pg": "^8.9.0", "pg-query-stream": "^4.3.0", "prettier": "^2.8.3", "redis": "^4.6.4", "remap-istanbul": "^0.13.0", "rimraf": "^4.1.2", "sinon": "^15.0.1", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.8.0", "sqlite3": "^5.1.4", "ts-node": "^10.9.2", "typeorm-aurora-data-api-driver": "^2.4.4", "typescript": "^5.3.3" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0", "mssql": "^9.1.1 || ^10.0.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^6.3.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", "dayjs": "^1.11.9", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^10.3.10", "mkdirp": "^2.1.3", "reflect-metadata": "^0.2.1", "sha.js": "^2.4.11", "tslib": "^2.5.0", "uuid": "^9.0.0", "yargs": "^17.6.2" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "eslint . --ext .ts", "format": "prettier --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } } | ||
{ "name": "typeorm", "private": false, "version": "0.3.20-dev.f232ba7", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">=16.13.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@tsconfig/node16": "^16.1.1", "@types/app-root-path": "^1.2.4", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/debug": "^4.1.7", "@types/gulp-rename": "^2.0.6", "@types/gulp-sourcemaps": "^0.0.38", "@types/mkdirp": "^1.0.2", "@types/mocha": "^10.0.1", "@types/node": "^18.13.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^10.0.13", "@types/source-map-support": "^0.5.6", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.22", "@typescript-eslint/eslint-plugin": "^6.17.0", "better-sqlite3": "^8.1.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^5.0.13", "conventional-changelog-cli": "^2.2.2", "del": "6.1.1", "eslint": "^8.44.0", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^10.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^8.0.3", "mocha": "^10.2.0", "mongodb": "^6.3.0", "mssql": "^10.0.1", "mysql": "^2.18.1", "mysql2": "^3.1.1", "pg": "^8.9.0", "pg-query-stream": "^4.3.0", "prettier": "^2.8.3", "redis": "^4.6.4", "remap-istanbul": "^0.13.0", "rimraf": "^4.1.2", "sinon": "^15.0.1", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.8.0", "sqlite3": "^5.1.4", "ts-node": "^10.9.2", "typeorm-aurora-data-api-driver": "^2.4.4", "typescript": "^5.3.3" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0", "mssql": "^9.1.1 || ^10.0.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^6.3.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", "dayjs": "^1.11.9", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^10.3.10", "mkdirp": "^2.1.3", "reflect-metadata": "^0.2.1", "sha.js": "^2.4.11", "tslib": "^2.5.0", "uuid": "^9.0.0", "yargs": "^17.6.2" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "eslint . --ext .ts", "format": "prettier --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } } |
@@ -285,3 +285,4 @@ "use strict"; | ||
if (valuesExpression) { | ||
if (this.connection.driver.options.type === "oracle" && | ||
if ((this.connection.driver.options.type === "oracle" || | ||
this.connection.driver.options.type === "sap") && | ||
this.getValueSets().length > 1) { | ||
@@ -288,0 +289,0 @@ query += ` ${valuesExpression}`; |
@@ -152,3 +152,5 @@ "use strict"; | ||
return this.expressionMap.mainAlias.metadata.columns.filter((column) => { | ||
return column.isUpdateDate || column.isVersion; | ||
return (column.asExpression !== undefined || | ||
column.isUpdateDate || | ||
column.isVersion); | ||
}); | ||
@@ -161,3 +163,4 @@ } | ||
return this.expressionMap.mainAlias.metadata.columns.filter((column) => { | ||
return (column.isUpdateDate || | ||
return (column.asExpression !== undefined || | ||
column.isUpdateDate || | ||
column.isVersion || | ||
@@ -164,0 +167,0 @@ column.isDeleteDate); |
@@ -507,13 +507,13 @@ | ||
/** | ||
* Set's LIMIT - maximum number of rows to be selected. | ||
* Sets LIMIT - maximum number of rows to be selected. | ||
* NOTE that it may not work as you expect if you are using joins. | ||
* If you want to implement pagination, and you are having join in your query, | ||
* then use instead take method instead. | ||
* then use the take method instead. | ||
*/ | ||
limit(limit?: number): this; | ||
/** | ||
* Set's OFFSET - selection offset. | ||
* Sets OFFSET - selection offset. | ||
* NOTE that it may not work as you expect if you are using joins. | ||
* If you want to implement pagination, and you are having join in your query, | ||
* then use instead skip method instead. | ||
* then use the skip method instead. | ||
*/ | ||
@@ -520,0 +520,0 @@ offset(offset?: number): this; |
@@ -40,11 +40,2 @@ import { Driver } from "../../driver/Driver"; | ||
/** | ||
* Returns whether an object is an iterrable | ||
* This is useful when trying to avoid objects such as Dates | ||
*/ | ||
private isIterrableObject; | ||
/** | ||
* Deeply nullify an object if all its properties values are null or undefined | ||
*/ | ||
private deeplyNullify; | ||
/** | ||
* Transforms joined entities in the given raw results by a given alias and stores to the given (parent) entity | ||
@@ -51,0 +42,0 @@ */ |
@@ -137,33 +137,5 @@ "use strict"; | ||
}); | ||
// Set all embedded column values to null if all their child columns are null | ||
if (entity) { | ||
metadata.embeddeds.forEach((embedded) => { | ||
if (embedded.propertyName in entity) { | ||
entity[embedded.propertyName] = this.deeplyNullify(entity[embedded.propertyName]); | ||
} | ||
}); | ||
} | ||
return hasData; | ||
} | ||
/** | ||
* Returns whether an object is an iterrable | ||
* This is useful when trying to avoid objects such as Dates | ||
*/ | ||
isIterrableObject(obj) { | ||
const prototype = Object.prototype.toString.call(obj); | ||
return prototype === "[object Object]" || prototype === "[object Array]"; | ||
} | ||
/** | ||
* Deeply nullify an object if all its properties values are null or undefined | ||
*/ | ||
deeplyNullify(obj) { | ||
if (!this.isIterrableObject(obj)) | ||
return obj; | ||
for (const key in obj) { | ||
obj[key] = this.deeplyNullify(obj[key]); | ||
} | ||
const nullify = Object.values(obj).every((value) => value == null); | ||
return nullify ? null : obj; | ||
} | ||
/** | ||
* Transforms joined entities in the given raw results by a given alias and stores to the given (parent) entity | ||
@@ -170,0 +142,0 @@ */ |
@@ -397,3 +397,4 @@ "use strict"; | ||
continue; | ||
if (DriverUtils_1.DriverUtils.isMySQLFamily(this.connection.driver)) { | ||
if (DriverUtils_1.DriverUtils.isMySQLFamily(this.connection.driver) || | ||
this.connection.driver.options.type === 'postgres') { | ||
const newComment = metadata.comment; | ||
@@ -400,0 +401,0 @@ await this.queryRunner.changeTableComment(table, newComment); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20431469
189334