Class PgStatementFormatter

java.lang.Object
org.pgcodekeeper.core.formatter.StatementFormatter
org.pgcodekeeper.core.formatter.pg.PgStatementFormatter

public class PgStatementFormatter extends StatementFormatter
PostgreSQL-specific implementation of SQL statement formatting. Handles formatting of PL/pgSQL functions and SQL statements with PostgreSQL-specific rules.
  • Constructor Details

    • PgStatementFormatter

      public PgStatementFormatter(int start, int stop, String functionDefinition, int defOffset, String language, FormatConfiguration config)
      Constructs a formatter for PostgreSQL functions from string definition.
      Parameters:
      start - The starting offset in the source text
      stop - The ending offset in the source text
      functionDefinition - The function definition text to format
      defOffset - The function definition's offset in the source
      language - The language of the function ('SQL' or 'plpgsql')
      config - The formatting configuration
    • PgStatementFormatter

      public PgStatementFormatter(int start, int stop, SQLParser.Function_bodyContext definition, org.antlr.v4.runtime.CommonTokenStream tokenStream, FormatConfiguration config)
      Constructs a formatter for PostgreSQL functions from parsed context.
      Parameters:
      start - The starting offset in the source text
      stop - The ending offset in the source text
      definition - The parsed function body context
      tokenStream - The token stream containing all tokens
      config - The formatting configuration
  • Method Details

    • getTokens

      public List<? extends org.antlr.v4.runtime.Token> getTokens()