Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,17 @@ const (
MySQL DriverType = "mysql"
Oracle DriverType = "oracle"
)
// GlobalStateSupportedDrivers is the canonical list of connectors that support GLOBAL state
var GlobalStateSupportedDrivers = []DriverType{Postgres, MySQL}

// IsGlobalStateSupported reports whether the given connector type supports GLOBAL state
func IsGlobalStateSupported(connectorType string) bool {
dt := DriverType(connectorType)
for _, d := range GlobalStateSupportedDrivers {
if d == dt {
return true
}
}
return false
}
var RelationalDrivers = []DriverType{Postgres, MySQL, Oracle}
3 changes: 2 additions & 1 deletion types/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ func GetStreamsDelta(oldStreams, newStreams *Catalog, connectorType string) *Cat

// flag for connector which have global state support
// TODO: create an array of global state supported connectors in constants
globalStateSupportedConnector := connectorType == string(constants.Postgres) || connectorType == string(constants.MySQL)
// flag for connectors which have global state support (centralized in constants)
globalStateSupportedConnector := constants.IsGlobalStateSupported(connectorType)

for namespace, newMetadatas := range newStreams.SelectedStreams {
for _, newMetadata := range newMetadatas {
Expand Down