@mikro-orm/core 7.1.6-dev.0 → 7.1.6-dev.10
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/EntityManager.d.ts +3 -3
- package/entity/defineEntity.d.ts +3 -2
- package/package.json +1 -1
- package/types/TimeType.d.ts +2 -2
- package/types/TimeType.js +1 -1
- package/utils/Utils.js +1 -1
package/EntityManager.d.ts
CHANGED
|
@@ -196,7 +196,7 @@ export declare class EntityManager<Driver extends IDatabaseDriver = IDatabaseDri
|
|
|
196
196
|
* }
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
|
-
findByCursor<Entity extends object, Hint extends string = never, Fields extends string = never, Excludes extends string = never, IncludeCount extends boolean = true, Using extends string = never>(entityName: EntityName<Entity>, options: WithUsingOptions<FindByCursorOptions<Entity
|
|
199
|
+
findByCursor<Entity extends object, Hint extends string = never, Fields extends string = never, Excludes extends string = never, IncludeCount extends boolean = true, Using extends string = never>(entityName: EntityName<Entity>, options: WithUsingOptions<FindByCursorOptions<NoInfer<Entity>, Hint, Fields, Excludes, IncludeCount>, NoInfer<Entity>, Using>): Promise<Cursor<Entity, Hint, Fields, Excludes, IncludeCount>>;
|
|
200
200
|
/**
|
|
201
201
|
* Refreshes the persistent state of an entity from the database, overriding any local changes that have not yet been
|
|
202
202
|
* persisted. Returns the same entity instance (same object reference), but re-hydrated. If the entity is no longer
|
|
@@ -319,7 +319,7 @@ export declare class EntityManager<Driver extends IDatabaseDriver = IDatabaseDri
|
|
|
319
319
|
/**
|
|
320
320
|
* Fires native insert query. Calling this has no side effects on the context (identity map).
|
|
321
321
|
*/
|
|
322
|
-
insert<Entity extends object>(entityNameOrEntity: EntityName<Entity> | Entity, data?: RequiredEntityData<Entity> | Entity
|
|
322
|
+
insert<Entity extends object>(entityNameOrEntity: EntityName<Entity> | Entity, data?: NoInfer<RequiredEntityData<Entity> | Entity>, options?: NativeInsertUpdateOptions<Entity>): Promise<Primary<Entity>>;
|
|
323
323
|
/**
|
|
324
324
|
* Clones rows matching the condition at the database level via INSERT...SELECT.
|
|
325
325
|
* Automatically excludes auto-increment PKs, generated columns, and resets version properties.
|
|
@@ -342,7 +342,7 @@ export declare class EntityManager<Driver extends IDatabaseDriver = IDatabaseDri
|
|
|
342
342
|
/**
|
|
343
343
|
* Fires native multi-insert query. Calling this has no side effects on the context (identity map).
|
|
344
344
|
*/
|
|
345
|
-
insertMany<Entity extends object>(entityNameOrEntities: EntityName<Entity> | Entity[], data?: RequiredEntityData<Entity>[] | Entity[]
|
|
345
|
+
insertMany<Entity extends object>(entityNameOrEntities: EntityName<Entity> | Entity[], data?: NoInfer<RequiredEntityData<Entity>[] | Entity[]>, options?: NativeInsertUpdateOptions<Entity>): Promise<Primary<Entity>[]>;
|
|
346
346
|
/**
|
|
347
347
|
* Fires native update query. Calling this has no side effects on the context (identity map).
|
|
348
348
|
*/
|
package/entity/defineEntity.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EntityManager } from '../EntityManager.js';
|
|
2
2
|
import type { ColumnType, PropertyOptions, ReferenceOptions, EnumOptions, EmbeddedOptions, ManyToOneOptions, OneToManyOptions, OneToOneOptions, ManyToManyOptions, IndexColumnOptions } from '../metadata/types.js';
|
|
3
|
-
import type { AnyString, GeneratedColumnCallback, Constructor, CheckCallback, FilterQuery, EntityName, Dictionary, EntityMetadata, PrimaryKeyProp, EntityRepositoryType, Hidden, Opt, Primary, EntityClass, EntitySchemaWithMeta, InferEntity, MaybeReturnType, Ref, LazyRef, IndexCallback, TriggerCallback, FormulaCallback, EntityCtor, IsNever, IWrappedEntity, DefineConfig, Config, MaybePromise, IndexHints } from '../typings.js';
|
|
3
|
+
import type { AnyString, GeneratedColumnCallback, Constructor, CheckCallback, FilterQuery, EntityName, Dictionary, EntityMetadata, PrimaryKeyProp, EntityRepositoryType, Hidden, Opt, Primary, EntityClass, EntitySchemaWithMeta, InferEntity, MaybeReturnType, Ref, LazyRef, IndexCallback, TriggerCallback, FormulaCallback, EntityCtor, IsNever, IWrappedEntity, DefineConfig, Config, MaybePromise, IndexHints, ExtractDefineEntityProperties } from '../typings.js';
|
|
4
4
|
import type { Raw } from '../utils/RawQueryFragment.js';
|
|
5
5
|
import type { ScalarReference } from './Reference.js';
|
|
6
6
|
import type { SerializeOptions } from '../serialization/EntitySerializer.js';
|
|
@@ -745,8 +745,9 @@ export type InferEntityFromProperties<Properties extends Record<string, any>, PK
|
|
|
745
745
|
forceObject: true;
|
|
746
746
|
}>;
|
|
747
747
|
} : {}) & {
|
|
748
|
-
[IndexHints]?: [Properties];
|
|
748
|
+
[IndexHints]?: [Omit<ExtractBaseProperties<Base>, keyof Properties> & Properties];
|
|
749
749
|
};
|
|
750
|
+
type ExtractBaseProperties<Base> = [ExtractDefineEntityProperties<Base>] extends [infer P extends Record<string, any>] ? [P] extends [never] ? {} : P : {};
|
|
750
751
|
type NarrowDiscriminator<Base, DiscColumn extends string | undefined, DiscValue> = DiscColumn extends string ? DiscColumn extends keyof Base ? DiscValue extends string | number ? Omit<Base, DiscColumn> & {
|
|
751
752
|
[K in DiscColumn]: DiscValue;
|
|
752
753
|
} : Base : Base : Base;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.1.6-dev.
|
|
3
|
+
"version": "7.1.6-dev.10",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
package/types/TimeType.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Type } from './Type.js';
|
|
|
2
2
|
import type { Platform } from '../platforms/Platform.js';
|
|
3
3
|
import type { EntityProperty } from '../typings.js';
|
|
4
4
|
/** Maps a database TIME column to a JS `string` in HH:MM:SS format. */
|
|
5
|
-
export declare class TimeType extends Type {
|
|
6
|
-
convertToDatabaseValue(value:
|
|
5
|
+
export declare class TimeType extends Type<string | null | undefined, string | null | undefined> {
|
|
6
|
+
convertToDatabaseValue(value: string | null | undefined, platform: Platform): string | null | undefined;
|
|
7
7
|
compareAsType(): string;
|
|
8
8
|
ensureComparable(): boolean;
|
|
9
9
|
getColumnType(prop: EntityProperty, platform: Platform): string;
|
package/types/TimeType.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ValidationError } from '../errors.js';
|
|
|
3
3
|
/** Maps a database TIME column to a JS `string` in HH:MM:SS format. */
|
|
4
4
|
export class TimeType extends Type {
|
|
5
5
|
convertToDatabaseValue(value, platform) {
|
|
6
|
-
if (value &&
|
|
6
|
+
if (value && !/^\d{2,}:(?:[0-5]\d):(?:[0-5]\d)$/.test(value)) {
|
|
7
7
|
throw ValidationError.invalidType(TimeType, value, 'JS');
|
|
8
8
|
}
|
|
9
9
|
return super.convertToDatabaseValue(value, platform);
|
package/utils/Utils.js
CHANGED
|
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
|
|
|
141
141
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
142
142
|
export class Utils {
|
|
143
143
|
static PK_SEPARATOR = '~~~';
|
|
144
|
-
static #ORM_VERSION = '7.1.6-dev.
|
|
144
|
+
static #ORM_VERSION = '7.1.6-dev.10';
|
|
145
145
|
/**
|
|
146
146
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
147
147
|
*/
|