import { ECSqlSchemaLocater } from "@itwin/ecschema-metadata";
import { QueryBinder, QueryRowFormat } from "@itwin/core-common";
export class TestSqlSchemaLocater extends ECSqlSchemaLocater {
    _iModel;
    constructor(iModel, queryOptions) {
        super(queryOptions);
        this._iModel = iModel;
    }
    async executeQuery(query, options) {
        const queryParameters = options && options.parameters ? QueryBinder.from(options.parameters) : undefined;
        return this._iModel.createQueryReader(query, queryParameters, {
            rowFormat: QueryRowFormat.UseECSqlPropertyNames
        })
            .toArray();
    }
    async getSchemaProps(_schemaKey) {
        throw new Error("Method not implemented.");
    }
    // All of the following methods are protected. Through the override in this test locater, the methods can
    // be exposed public and used in tests for granular testing.
    async getSchemaJson(schemaKey, context) {
        return super.getSchemaJson(schemaKey, context);
    }
    async getConstants(schema, context) {
        return super.getConstants(schema, context);
    }
    async getCustomAttributeClasses(schema, context, queryOverride) {
        return super.getCustomAttributeClasses(schema, context, queryOverride);
    }
    async getEntities(schema, context, queryOverride) {
        return super.getEntities(schema, context, queryOverride);
    }
    async getEnumerations(schema, context) {
        return super.getEnumerations(schema, context);
    }
    async getFormats(schema, context) {
        return super.getFormats(schema, context);
    }
    async getInvertedUnits(schema, context) {
        return super.getInvertedUnits(schema, context);
    }
    async getKindOfQuantities(schema, context) {
        return super.getKindOfQuantities(schema, context);
    }
    async getMixins(schema, context, queryOverride) {
        return super.getMixins(schema, context, queryOverride);
    }
    async getPhenomenon(schema, context) {
        return super.getPhenomenon(schema, context);
    }
    async getPropertyCategories(schema, context) {
        return super.getPropertyCategories(schema, context);
    }
    async getRelationships(schema, context) {
        return super.getRelationships(schema, context);
    }
    async getStructs(schema, context) {
        return super.getStructs(schema, context);
    }
    async getUnits(schema, context) {
        return super.getUnits(schema, context);
    }
    async getUnitSystems(schema, context) {
        return super.getUnitSystems(schema, context);
    }
}
//# sourceMappingURL=TestSqlSchemaLocater.js.map