java.lang.Object
org.postgresql.pljava.internal.SPI

public class SPI extends Object
The SPI class provides access to some global variables used by SPI.
Author:
Thomas Hallgren
  • Field Details

  • Constructor Details

    • SPI

      public SPI()
  • Method Details

    • exec

      @Deprecated public static int exec(String command, int rowCount)
      Deprecated.
      This seems never to have been used in git history of project.
      Execute a command using the internal SPI_exec function.
      Parameters:
      command - The command to execute.
      rowCount - The maximum number of tuples to create. A value of rowCount of zero is interpreted as no limit, i.e., run to completion.
      Returns:
      One of the declared status codes.
    • freeTupTable

      public static void freeTupTable()
      Frees a tuple table returned by SPI.

      This legacy method has no parameter, and frees whatever tuple table the SPI_tuptable global points to at the moment; beware if SPI has returned any newer result since the one you might think you are freeing!

    • getProcessed

      public static long getProcessed()
      Returns the value of the global variable SPI_processed.
    • getResult

      public static int getResult()
      Returns the value of the global variable SPI_result.
    • getTuples

      public static TupleList getTuples(TupleTableSlotImpl ttsi)
      Returns a List of the supplied TupleTableSlot covering the tuples pointed to from the pointer array that the global SPI_tuptable points to.

      This is an internal, not an API, method, and it does nothing to check that the supplied ttsi fits the tuples SPI has returned. The caller is to ensure that.

      Returns:
      null if the global SPI_tuptable is null
    • getTupTable

      public static TupleTable getTupTable(TupleDesc known)
      Returns the tuples located by the global variable SPI_tuptable as an instance of the legacy TupleTable class.
    • getResultText

      public static String getResultText(int resultCode)
      Returns a textual representation of a result code.