import { defaultFormat } from "../ivm/default-format.js";
import { ExpressionBuilder } from "./expression.js";
import { AbstractQuery, newQuerySymbol } from "./query-impl.js";
export function staticQuery(schema, tableName) {
    return new StaticQuery(schema, tableName, { table: tableName }, defaultFormat);
}
/**
 * A query that cannot be run.
 * Only serves to generate ASTs.
 */
export class StaticQuery extends AbstractQuery {
    constructor(schema, tableName, ast, format, system = 'permissions', customQueryID, currentJunction) {
        super(undefined, schema, tableName, ast, format, system, customQueryID, currentJunction);
    }
    expressionBuilder() {
        return new ExpressionBuilder(this._exists);
    }
    [newQuerySymbol](_delegate, schema, tableName, ast, format, customQueryID, currentJunction) {
        return new StaticQuery(schema, tableName, ast, format, 'permissions', customQueryID, currentJunction);
    }
    get ast() {
        return this._completeAst();
    }
    materialize() {
        throw new Error('StaticQuery cannot be materialized');
    }
    run() {
        return Promise.reject(new Error('StaticQuery cannot be run'));
    }
    preload() {
        throw new Error('StaticQuery cannot be preloaded');
    }
}
//# sourceMappingURL=static-query.js.map