(
meta: EntityMetadata<T>,
where: FilterQuery<T>,
overrides?: EntityData<T>,
options: NativeInsertUpdateOptions<T> = {},
)
| 980 | } |
| 981 | |
| 982 | private async nativeCloneSimple<T extends object>( |
| 983 | meta: EntityMetadata<T>, |
| 984 | where: FilterQuery<T>, |
| 985 | overrides?: EntityData<T>, |
| 986 | options: NativeInsertUpdateOptions<T> = {}, |
| 987 | ): Promise<QueryResult<T>> { |
| 988 | const props = this.getCloneableProps(meta); |
| 989 | const mappedOverrides = this.mapCloneOverrides(overrides, meta, options); |
| 990 | const { selectFields, insertColumns } = this.buildCloneFields(props, mappedOverrides, meta); |
| 991 | |
| 992 | const abort = pickAbortOptions(options); |
| 993 | const selectQb = this.createQueryBuilder<T>( |
| 994 | meta.class, |
| 995 | options.ctx, |
| 996 | 'read', |
| 997 | options.convertCustomTypes, |
| 998 | options.loggerContext, |
| 999 | ).withSchema(this.getSchemaName(meta, options)); |
| 1000 | selectQb.select(selectFields as any).where(where as any); |
| 1001 | selectQb.setAbortOptions(abort); |
| 1002 | |
| 1003 | const insertQb = this.createQueryBuilder<T>( |
| 1004 | meta.class, |
| 1005 | options.ctx, |
| 1006 | 'write', |
| 1007 | options.convertCustomTypes, |
| 1008 | options.loggerContext, |
| 1009 | ).withSchema(this.getSchemaName(meta, options)); |
| 1010 | insertQb.setAbortOptions(abort); |
| 1011 | |
| 1012 | return this.rethrow( |
| 1013 | (insertQb as AnyQueryBuilder<T>) |
| 1014 | .insertFrom(selectQb as AnyQueryBuilder<T>, { columns: insertColumns as any }) |
| 1015 | .execute('run', false), |
| 1016 | ); |
| 1017 | } |
| 1018 | |
| 1019 | private async nativeCloneTPT<T extends object>( |
| 1020 | leafMeta: EntityMetadata<T>, |
nothing calls this directly
no test coverage detected