Class DefaultTableRepository
- java.lang.Object
-
- com.snowflake.connectors.common.table.DefaultTableRepository
-
- All Implemented Interfaces:
TableLister
,TableRepository
public class DefaultTableRepository extends Object implements TableRepository
Implements operations on snowflake TABLE objects
-
-
Constructor Summary
Constructors Constructor Description DefaultTableRepository(Session session)
Creates a newDefaultTableRepository
, using a defaultTableLister
implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dropTableIfExists(ObjectName table)
Drops given table if it existsvoid
renameTable(ObjectName oldTable, ObjectName newTable)
Renames the tableList<TableProperties>
showTables(SchemaName schema)
Returns list of tables for a given schema.List<TableProperties>
showTables(SchemaName schema, String like)
Returns list of tables for a given schema with additional filter expression.
-
-
-
Constructor Detail
-
DefaultTableRepository
public DefaultTableRepository(Session session)
Creates a newDefaultTableRepository
, using a defaultTableLister
implementation.- Parameters:
session
- Snowpark session object
-
-
Method Detail
-
dropTableIfExists
public void dropTableIfExists(ObjectName table)
Description copied from interface:TableRepository
Drops given table if it exists- Specified by:
dropTableIfExists
in interfaceTableRepository
- Parameters:
table
- table to drop
-
renameTable
public void renameTable(ObjectName oldTable, ObjectName newTable)
Description copied from interface:TableRepository
Renames the table- Specified by:
renameTable
in interfaceTableRepository
- Parameters:
oldTable
- old tablenewTable
- new table
-
showTables
public List<TableProperties> showTables(SchemaName schema)
Description copied from interface:TableLister
Returns list of tables for a given schema.- Specified by:
showTables
in interfaceTableLister
- Parameters:
schema
- schema name- Returns:
- list of tables for a given schema
-
showTables
public List<TableProperties> showTables(SchemaName schema, String like)
Description copied from interface:TableLister
Returns list of tables for a given schema with additional filter expression.- Specified by:
showTables
in interfaceTableLister
- Parameters:
schema
- schema namelike
- filter expression (case-sensitive), e.g.MYTABLE
or%TAB%
- Returns:
- list of tables
-
-