import { EntityRepository } from '@mikro-orm/core';
/** SQL-specific entity repository with QueryBuilder support. */
export class SqlEntityRepository extends EntityRepository {
  em;
  constructor(em, entityName) {
    super(em, entityName);
    this.em = em;
  }
  /**
   * Creates a QueryBuilder instance
   */
  createQueryBuilder(alias) {
    return this.getEntityManager().createQueryBuilder(this.entityName, alias);
  }
  /**
   * Shortcut for `createQueryBuilder()`
   */
  qb(alias) {
    return this.createQueryBuilder(alias);
  }
  /**
   * @inheritDoc
   */
  getEntityManager() {
    return this.em;
  }
}
