Libraries v5.0.0
    Preparing search index...

    Type Alias QueryDefinition<Q, P>

    QueryDefinition: Omit<Q, ConnectionTerminal | "query"> & {
        "[QUERY_SOURCE]": Q;
        query(
            knex: Knex,
            ...args: QueryArguments<P>,
        ): Q extends { "[PARAMETER_READER]": infer F extends ParameterReader }
            ? (F & { connection: true; parameters: [] })["result"]
            : never;
        toSQL(knex: Knex, ...args: QueryArguments<P>): BoundQuerySql;
        (
            knex: Knex,
            ...args: QueryArguments<P>,
        ): Promise<Q extends { rowSchema: infer S } ? InferType<S>[] : never>;
    }

    A reusable, non-thenable SELECT definition, independent of any Knex client.

    Type Parameters

    Type Declaration

      • (
            knex: Knex,
            ...args: QueryArguments<P>,
        ): Promise<Q extends { rowSchema: infer S } ? InferType<S>[] : never>
      • Execute using the caller-owned connection or transaction and positional values.

        Parameters

        Returns Promise<Q extends { rowSchema: infer S } ? InferType<S>[] : never>

    • Readonly[QUERY_SOURCE]: Q
    • query: function
      • Bind a fresh ordinary reader for composition, pagination or supported writes.

        Parameters

        Returns Q extends { "[PARAMETER_READER]": infer F extends ParameterReader }
            ? (F & { connection: true; parameters: [] })["result"]
            : never

    • toSQL: function