MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / constructor

Method constructor

packages/sql/src/query/QueryBuilder.ts:658–677  ·  view source on GitHub ↗

* @internal

(
    entityName: EntityName<Entity> | QueryBuilder<Entity, any, any, any>,
    protected readonly metadata: MetadataStorage,
    protected readonly driver: AbstractSqlDriver,
    protected readonly context?: Transaction,
    alias?: string,
    protected connectionType?: ConnectionType,
    protected em?: SqlEntityManager,
    protected loggerContext?: LoggingOptions & Dictionary,
  )

Source from the content-addressed store, hash-verified

656 * @internal
657 */
658 constructor(
659 entityName: EntityName<Entity> | QueryBuilder<Entity, any, any, any>,
660 protected readonly metadata: MetadataStorage,
661 protected readonly driver: AbstractSqlDriver,
662 protected readonly context?: Transaction,
663 alias?: string,
664 protected connectionType?: ConnectionType,
665 protected em?: SqlEntityManager,
666 protected loggerContext?: LoggingOptions & Dictionary,
667 ) {
668 this.platform = this.driver.getPlatform();
669
670 if (alias) {
671 this.#state.aliasCounter++;
672 this.#state.explicitAlias = true;
673 }
674
675 // @ts-expect-error union type does not match the overloaded method signature
676 this.from(entityName, alias);
677 }
678
679 /**
680 * Creates a SELECT query, specifying the fields to retrieve.

Callers

nothing calls this directly

Calls 2

fromMethod · 0.95
getPlatformMethod · 0.65

Tested by

no test coverage detected