"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionBuilder = void 0;
const query_builder_js_1 = require("./query-builder.js");
/**
 * A builder for creating subqueries on linked records.
 * This is used internally by the `with` method on the `QueryBuilder`.
 * @template DB - The database type.
 * @template CurrentTableName - The name of the table the selection is starting from.
 */
class SelectionBuilder {
    _executor;
    constructor(executor) {
        this._executor = executor;
    }
    /**
     * Creates a new query builder for a linked table.
     * @param from - The name of the link field to select from.
     * @returns A new `QueryBuilder` instance for the linked table.
     */
    useLink(from) {
        return new query_builder_js_1.QueryBuilder({
            field: from,
            fields: [],
            filtersSet: { conjunction: 'and', filtersSet: [] },
            queryType: 'link',
        }, this._executor);
    }
}
exports.SelectionBuilder = SelectionBuilder;
//# sourceMappingURL=selection-builder.js.map