(schemaName string)
| 1288 | } |
| 1289 | |
| 1290 | func (e *ExtractorOracle) findSchemaConfig(schemaName string) *common.DataSource { |
| 1291 | if schemaName == "" { |
| 1292 | return nil |
| 1293 | } |
| 1294 | for i := range e.replicateDoDb { |
| 1295 | if e.replicateDoDb[i].TableSchema == schemaName { |
| 1296 | return e.replicateDoDb[i] |
| 1297 | } else if regStr := e.replicateDoDb[i].TableSchemaRegex; regStr != "" { |
| 1298 | reg, err := regexp.Compile(regStr) |
| 1299 | if nil != err { |
| 1300 | continue |
| 1301 | } |
| 1302 | if reg.MatchString(schemaName) { |
| 1303 | return e.replicateDoDb[i] |
| 1304 | } |
| 1305 | } |
| 1306 | } |
| 1307 | schemaConfig := &common.DataSource{TableSchema: schemaName} |
| 1308 | e.replicateDoDb = append(e.replicateDoDb, schemaConfig) |
| 1309 | return schemaConfig |
| 1310 | } |
| 1311 | |
| 1312 | func findTableConfig(schema *common.DataSource, tableName string) *common.Table { |
| 1313 | if schema != nil { |
no outgoing calls