TableOperationsClient

Client interface for database table operations.

Provides a standard set of operations for managing database namespaces, tables, and data manipulation across different database implementations. Implementations should handle database-specific SQL generation and execution while maintaining consistent behavior across the interface methods.

Functions

Link copied to clipboard
abstract suspend fun copyTable(columnNameMapping: ColumnNameMapping, sourceTableName: TableName, targetTableName: TableName)

Inserts records from source table to target table

Link copied to clipboard
open suspend fun countTable(tableName: TableName): Long?

Returns the row count of a table, or null if the table doesn't exist.

Link copied to clipboard
open suspend fun createNamespace(namespace: String)

Creates a new namespace (database/schema).

Link copied to clipboard
abstract suspend fun createTable(stream: DestinationStream, tableName: TableName, columnNameMapping: ColumnNameMapping, replace: Boolean)

Creates a table with the given schema and column mapping.

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

Drops a table.

Link copied to clipboard
open suspend fun getGenerationId(tableName: TableName): Long

Returns generation ID from an arbitrary record in the table (0 if null).

Link copied to clipboard
open suspend fun namespaceExists(namespace: String): Boolean

Checks if a namespace exists.

Link copied to clipboard
abstract suspend fun overwriteTable(sourceTableName: TableName, targetTableName: TableName)

Replaces table — target table becomes source table and source table is dropped

Link copied to clipboard
open suspend fun tableExists(table: TableName): Boolean

Checks if a table exists.

Link copied to clipboard
abstract suspend fun upsertTable(stream: DestinationStream, columnNameMapping: ColumnNameMapping, sourceTableName: TableName, targetTableName: TableName)

Upserts records from source table to target table