Class PostgresSchema

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • readToastableColumns

        private final boolean readToastableColumns
    • Method Detail

      • refresh

        protected PostgresSchema refresh​(PostgresConnection connection,
                                         boolean printReplicaIdentityInfo)
                                  throws SQLException
        Initializes the content for this schema by reading all the database information from the supplied connection.
        Parameters:
        connection - a JdbcConnection instance, never null
        printReplicaIdentityInfo - whether or not to look and print out replica identity information about the tables
        Returns:
        this object so methods can be chained together; never null
        Throws:
        SQLException - if there is a problem obtaining the schema from the database server
      • refresh

        protected void refresh​(PostgresConnection connection,
                               TableId tableId,
                               boolean refreshToastableColumns)
                        throws SQLException
        Refreshes this schema's content for a particular table
        Parameters:
        connection - a JdbcConnection instance, never null
        tableId - the table identifier; may not be null
        refreshToastableColumns - refreshes the cache of toastable columns for `tableId`, if true
        Throws:
        SQLException - if there is a problem refreshing the schema from the database server
      • isFilteredOut

        protected boolean isFilteredOut​(TableId id)
      • refreshSchemas

        protected void refreshSchemas()
        Discard any currently-cached schemas and rebuild them using the filters.
      • getToastableColumnsForTableId

        public List<String> getToastableColumnsForTableId​(TableId tableId)
      • applySchemaChangesForTable

        public void applySchemaChangesForTable​(int relationId,
                                               Table table)
        Applies schema changes for the specified table.
        Parameters:
        relationId - the postgres relation unique identifier for the table
        table - externally constructed table, typically from the decoder; must not be null
      • tableFor

        public Table tableFor​(int relationId)
        Resolve a Table based on a supplied table relation unique identifier.

        This implementation relies on a prior call to applySchemaChangesForTable(int, Table) to have applied schema changes from a replication stream with the relationId for the relationship to exist and be capable of lookup.

        Parameters:
        relationId - the unique table relation identifier
        Returns:
        the resolved table or null