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

Method createQueryBuilder

packages/mssql/src/MsSqlDriver.ts:81–110  ·  view source on GitHub ↗
(
    entityName: EntityName<T>,
    ctx?: Transaction,
    preferredConnectionType?: ConnectionType,
    convertCustomTypes?: boolean,
    loggerContext?: LoggingOptions,
    alias?: string,
    em?: SqlEntityManager,
  )

Source from the content-addressed store, hash-verified

79 }
80
81 override createQueryBuilder<T extends AnyEntity<T>>(
82 entityName: EntityName<T>,
83 ctx?: Transaction,
84 preferredConnectionType?: ConnectionType,
85 convertCustomTypes?: boolean,
86 loggerContext?: LoggingOptions,
87 alias?: string,
88 em?: SqlEntityManager,
89 ): MsSqlQueryBuilder<T, any, any, any> {
90 // do not compute the connectionType if EM is provided as it will be computed from it in the QB later on
91 const connectionType = em
92 ? preferredConnectionType
93 : this.resolveConnectionType({ ctx, connectionType: preferredConnectionType });
94 const qb = new MsSqlQueryBuilder<T, any, any, any>(
95 entityName,
96 this.metadata,
97 this,
98 ctx,
99 alias,
100 connectionType,
101 em,
102 loggerContext,
103 );
104
105 if (!convertCustomTypes) {
106 qb.unsetFlag(QueryFlag.CONVERT_CUSTOM_TYPES);
107 }
108
109 return qb;
110 }
111
112 private appendOutputTable<T extends AnyEntity<T>>(
113 entityName: EntityName<T>,

Calls 1

unsetFlagMethod · 0.65

Tested by 3

initialMetadataProcessorFunction · 0.36
getOneWithStudentsMethod · 0.36
getAllWithStudentsMethod · 0.36