@mikro-orm/core 7.0.0-dev.144 → 7.0.0-dev.146
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.
- package/entity/EntityRepository.d.ts +5 -1
- package/entity/EntityRepository.js +6 -0
- package/package.json +1 -1
- package/typings.d.ts +2 -2
- package/utils/Utils.js +1 -1
|
@@ -2,7 +2,7 @@ import type { PopulatePath } from '../enums.js';
|
|
|
2
2
|
import type { CreateOptions, EntityManager, MergeOptions } from '../EntityManager.js';
|
|
3
3
|
import type { AssignOptions } from './EntityAssigner.js';
|
|
4
4
|
import type { EntityData, EntityName, Primary, Loaded, FilterQuery, EntityDictionary, AutoPath, RequiredEntityData, Ref, EntityType, EntityDTO, MergeSelected, FromEntityType, IsSubset, MergeLoaded, ArrayElement } from '../typings.js';
|
|
5
|
-
import type { CountOptions, DeleteOptions, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, GetReferenceOptions, NativeInsertUpdateOptions, UpdateOptions, UpsertManyOptions, UpsertOptions } from '../drivers/IDatabaseDriver.js';
|
|
5
|
+
import type { CountOptions, DeleteOptions, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, GetReferenceOptions, NativeInsertUpdateOptions, StreamOptions, UpdateOptions, UpsertManyOptions, UpsertOptions } from '../drivers/IDatabaseDriver.js';
|
|
6
6
|
import type { EntityLoaderOptions } from './EntityLoader.js';
|
|
7
7
|
import type { Cursor } from '../utils/Cursor.js';
|
|
8
8
|
export declare class EntityRepository<Entity extends object> {
|
|
@@ -85,6 +85,10 @@ export declare class EntityRepository<Entity extends object> {
|
|
|
85
85
|
* Finds all entities of given type. You can pass additional options via the `options` parameter.
|
|
86
86
|
*/
|
|
87
87
|
findAll<Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(options?: FindAllOptions<Entity, Hint, Fields, Excludes>): Promise<Loaded<Entity, Hint, Fields, Excludes>[]>;
|
|
88
|
+
/**
|
|
89
|
+
* @inheritDoc EntityManager.stream
|
|
90
|
+
*/
|
|
91
|
+
stream<Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(options?: StreamOptions<Entity, Hint, Fields, Excludes>): AsyncIterableIterator<Loaded<Entity, Hint, Fields, Excludes>>;
|
|
88
92
|
/**
|
|
89
93
|
* @inheritDoc EntityManager.insert
|
|
90
94
|
*/
|
|
@@ -99,6 +99,12 @@ export class EntityRepository {
|
|
|
99
99
|
async findAll(options) {
|
|
100
100
|
return this.getEntityManager().findAll(this.entityName, options);
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* @inheritDoc EntityManager.stream
|
|
104
|
+
*/
|
|
105
|
+
async *stream(options) {
|
|
106
|
+
yield* this.getEntityManager().stream(this.entityName, options);
|
|
107
|
+
}
|
|
102
108
|
/**
|
|
103
109
|
* @inheritDoc EntityManager.insert
|
|
104
110
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.146",
|
|
5
5
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
package/typings.d.ts
CHANGED
|
@@ -745,13 +745,13 @@ export type PopulateOptions<T> = {
|
|
|
745
745
|
type Loadable<T extends object> = Collection<T, any> | Reference<T> | Ref<T> | readonly T[];
|
|
746
746
|
type ExtractType<T> = T extends Loadable<infer U> ? U : T;
|
|
747
747
|
type ExtractStringKeys<T> = {
|
|
748
|
-
[K in keyof T]
|
|
748
|
+
[K in keyof T]-?: CleanKeys<T, K>;
|
|
749
749
|
}[keyof T] & {};
|
|
750
750
|
type StringKeys<T, E extends string = never> = T extends Collection<any, any> ? ExtractStringKeys<ExtractType<T>> | E : T extends Reference<any> ? ExtractStringKeys<ExtractType<T>> | E : T extends object ? ExtractStringKeys<ExtractType<T>> | E : never;
|
|
751
751
|
type GetStringKey<T, K extends StringKeys<T, string>, E extends string> = K extends keyof T ? ExtractType<T[K]> : (K extends E ? keyof T : never);
|
|
752
752
|
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
753
753
|
type CollectionKeys<T> = T extends object ? {
|
|
754
|
-
[K in keyof T]
|
|
754
|
+
[K in keyof T]-?: T[K] extends Collection<any> ? IsAny<T[K]> extends true ? never : K & string : never;
|
|
755
755
|
}[keyof T] & {} : never;
|
|
756
756
|
export type AutoPath<O, P extends string | boolean, E extends string = never, D extends Prev[number] = 9> = P extends boolean ? P : [D] extends [never] ? never : P extends any ? P extends string ? (P & `${string}.` extends never ? P : P & `${string}.`) extends infer Q ? Q extends `${infer A}.${infer B}` ? A extends StringKeys<O, E> ? `${A}.${AutoPath<NonNullable<GetStringKey<O, A, E>>, B, E, Prev[D]>}` : never : Q extends StringKeys<O, E> ? (NonNullable<GetStringKey<O, Q, E>> extends unknown ? Exclude<P, `${string}.`> : never) | (StringKeys<NonNullable<GetStringKey<O, Q, E>>, E> extends never ? never : `${Q & string}.`) : StringKeys<O, E> | `${CollectionKeys<O>}:ref` : never : never : never;
|
|
757
757
|
export type UnboxArray<T> = T extends any[] ? ArrayElement<T> : T;
|
package/utils/Utils.js
CHANGED
|
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
|
|
|
123
123
|
}
|
|
124
124
|
export class Utils {
|
|
125
125
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.0-dev.
|
|
126
|
+
static #ORM_VERSION = '7.0.0-dev.146';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|