Class PgOverridesListener

java.lang.Object
org.pgcodekeeper.core.database.base.parser.CustomParserListener<PgDatabase>
org.pgcodekeeper.core.database.pg.parser.PgOverridesListener
All Implemented Interfaces:
AntlrContextProcessor<SQLParser.SqlContext>, IPgContextProcessor

public final class PgOverridesListener extends CustomParserListener<PgDatabase> implements IPgContextProcessor
Custom ANTLR listener for processing PostgreSQL SQL statements with override support. Handles schema and ownership changes while applying statement overrides.
  • Constructor Details

    • PgOverridesListener

      public PgOverridesListener(PgDatabase db, String filename, ParserListenerMode mode, DiffSettings diffSettings, Map<AbstractStatement,StatementOverride> overrides)
      Creates a new listener with override support.
      Parameters:
      db - the target database schema
      filename - name of the file being parsed
      mode - parsing mode
      diffSettings - unified context object containing settings, monitor, and error accumulator
      overrides - map of statement overrides to apply
  • Method Details

    • process

      public void process(SQLParser.SqlContext rootCtx, org.antlr.v4.runtime.CommonTokenStream stream)
      Processes the complete SQL file context. Extracts and processes schema statements that may need overrides.
      Specified by:
      process in interface AntlrContextProcessor<SQLParser.SqlContext>
      Parameters:
      rootCtx - the root file context from ANTLR parser
      stream - the token stream associated with the context