-
Notifications
You must be signed in to change notification settings - Fork 7
/
connector.go
27 lines (23 loc) · 1.06 KB
/
connector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package coreinterfaces
import (
"database/sql"
"github.com/pingcap/tiflow/pkg/sink/cloudstorage"
)
/// Connector is the interface for Data Warehouse connector
/// One Connector is responsible for one table.
/// Any data warehouse should implement this interface.
/// All Data Warehouse related operations should be done through this.
type Connector interface {
// InitSchema initializes the schema of the table
InitSchema(columns []cloudstorage.TableCol) error
// CopyTableSchema copies the table schema from the source database to the Data Warehouse
CopyTableSchema(sourceDatabase string, sourceTable string, sourceTiDBConn *sql.DB) error
// LoadSnapshot loads the snapshot file into the Data Warehouse
LoadSnapshot(targetTable, filePath string) error
// ExecDDL executes the DDL statements in Data Warehouse
ExecDDL(tableDef cloudstorage.TableDefinition) error
// LoadIncrement loads the increment data into the Data Warehouse
LoadIncrement(tableDef cloudstorage.TableDefinition, filePath string) error
// Close closes the connection to the Data Warehouse
Close()
}