TableSchemaEvolutionClient

Database-specific schema evolution operations.

This interface encapsulates schema evolution and synchronization operations. Implementations handle the details of schema migration, including type compatibility, column mapping, constraint management, and database-specific quirks when aligning source stream schemas with destination table structures.

These operations typically involve:

  • Schema introspection and comparison

  • Type system translation between source and destination

  • Safe schema evolution strategies (adding/modifying columns)

  • Handling of database-specific constraints and limitations

  • Preservation of data integrity during schema changes

See also

for standard SQL-based table operations

Functions

Link copied to clipboard
abstract suspend fun applyChangeset(stream: DestinationStream, columnNameMapping: ColumnNameMapping, tableName: TableName, expectedColumns: TableColumns, columnChangeset: ColumnChangeset)

Execute the changeset against the destination. After this method completes, a call to discoverSchema should return an identical schema as computeSchema.

Link copied to clipboard
open fun computeChangeset(actualColumns: TableColumns, expectedColumns: TableColumns): ColumnChangeset

Generate a changeset which, when applied to this, will result in expectedColumns.

Link copied to clipboard
abstract fun computeSchema(stream: DestinationStream, columnNameMapping: ColumnNameMapping): TableSchema

Compute the schema that we expect the table to have, given the stream. This should not query the destination in any way.

Link copied to clipboard
abstract suspend fun discoverSchema(tableName: TableName): TableSchema

Query the destination and discover the schema of an existing table. If this method includes the _airbyte_* columns, then computeSchema MUST also include those columns.

Link copied to clipboard
open suspend fun ensureSchemaMatches(stream: DestinationStream, tableName: TableName, columnNameMapping: ColumnNameMapping)

Ensures the destination table schema matches the expected stream schema through introspection and reconciliation.