Interface Statement

    • Method Detail

      • execute

        StatementResult execute​(ExecutionContext ctx)
        Execute a CohQL query or command and return the relevant result.
        Parameters:
        ctx - the context to use
        Returns:
        a StatementResult containing the results of executing the statement
      • sanityCheck

        void sanityCheck​(ExecutionContext ctx)
        Perform sanity checks on the statement that will be executed.

        Implementations can fail sanity checking by throwing an unchecked exception (RuntimeException).

        Parameters:
        ctx - the context to use
        Throws:
        RuntimeException - if sanity checking fails
      • showPlan

        void showPlan​(PrintWriter out)
        Output to the provided PrintWriter a human readable trace of the actions that will be taken by this statement if or when executed.
        Parameters:
        out - the PrintWriter to write the trace to
      • getExecutionConfirmation

        String getExecutionConfirmation​(ExecutionContext ctx)
        Return a string that will be used as a question to confirm execution of a statement. If null is returned then no confirmation is required.
        Parameters:
        ctx - the context to use
        Returns:
        a String that will be used to confirm execution of a statement
      • isManagingTimeout

        default boolean isManagingTimeout()
        Obtain a flag indicating whether this Statement will manage its own timeout handling.
        Returns:
        true if this Statement manages timeout handling or false if the StatementExecutor should manage timeouts.