Class SqlServerMetadataAccessor
- java.lang.Object
-
- org.apache.flink.cdc.connectors.sqlserver.source.SqlServerMetadataAccessor
-
- All Implemented Interfaces:
MetadataAccessor
@Internal public class SqlServerMetadataAccessor extends Object implements MetadataAccessor
-
-
Constructor Summary
Constructors Constructor Description SqlServerMetadataAccessor(SqlServerSourceConfig sourceConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemagetTableSchema(TableId tableId)Get theSchemaof the given table.List<String>listNamespaces()List all databases from SQL Server.List<String>listSchemas(String namespace)List all schemas from SQL Server database.List<TableId>listTables(String namespace, String schemaName)List tables from SQL Server.
-
-
-
Constructor Detail
-
SqlServerMetadataAccessor
public SqlServerMetadataAccessor(SqlServerSourceConfig sourceConfig)
-
-
Method Detail
-
listNamespaces
public List<String> listNamespaces()
List all databases from SQL Server.- Specified by:
listNamespacesin interfaceMetadataAccessor- Returns:
- The list of database names
-
listSchemas
public List<String> listSchemas(@Nullable String namespace)
List all schemas from SQL Server database.- Specified by:
listSchemasin interfaceMetadataAccessor- Parameters:
namespace- The database name to list schemas from.- Returns:
- The list of schema names
-
listTables
public List<TableId> listTables(@Nullable String namespace, @Nullable String schemaName)
List tables from SQL Server.- Specified by:
listTablesin interfaceMetadataAccessor- Parameters:
namespace- The database name. If null, uses the configured database.schemaName- The schema name. If null, list tables from all schemas.- Returns:
- The list of
TableIds.
-
getTableSchema
public Schema getTableSchema(TableId tableId)
Get theSchemaof the given table.- Specified by:
getTableSchemain interfaceMetadataAccessor- Parameters:
tableId- TheTableIdof the given table.- Returns:
- The
Schemaof the table.
-
-