@simplysm/sd-orm-common
Advanced tools
Comparing version 11.1.25 to 11.1.26
@@ -61,2 +61,3 @@ import { DbContext } from "./DbContext"; | ||
countAsync(): Promise<number>; | ||
countAsync(fwd: (entity: TEntity<T>) => TEntityValue<any>): Promise<number>; | ||
existsAsync(): Promise<boolean>; | ||
@@ -63,0 +64,0 @@ bulkInsertAsync(records: TInsertObject<T>[]): Promise<void>; |
@@ -786,3 +786,3 @@ import { FunctionUtil, NeverEntryError, ObjectUtil } from "@simplysm/sd-core-common"; | ||
} | ||
async countAsync() { | ||
async countAsync(fwd) { | ||
if (this._def.distinct) { | ||
@@ -793,3 +793,5 @@ throw new Error("distinct 이후엔 'countAsync'를 사용할 수 없습니다." | ||
} | ||
const queryable = this.select(() => ({ cnt: new QueryUnit(Number, "COUNT(*)") })); /*.lock();*/ | ||
const queryable = fwd | ||
? this.select(() => ({ cnt: this.db.qh.count(fwd(this._entity)) })) | ||
: this.select(() => ({ cnt: this.db.qh.count() })); | ||
delete queryable._def.orderBy; | ||
@@ -796,0 +798,0 @@ const item = await queryable.singleAsync(); |
{ | ||
"name": "@simplysm/sd-orm-common", | ||
"version": "11.1.25", | ||
"version": "11.1.26", | ||
"description": "심플리즘 패키지 - ORM 모듈 (common)", | ||
@@ -19,4 +19,4 @@ "author": "김석래", | ||
"dependencies": { | ||
"@simplysm/sd-core-common": "11.1.25" | ||
"@simplysm/sd-core-common": "11.1.26" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
563960
9876
+ Added@simplysm/sd-core-common@11.1.26(transitive)
- Removed@simplysm/sd-core-common@11.1.25(transitive)