Skip to content

Commit

Permalink
feat: add extractor for oracle, mysql and db2 database
Browse files Browse the repository at this point in the history
  • Loading branch information
youen committed Oct 3, 2023
1 parent b48b0fa commit 5ef468e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion cmd/lino/dep_analyse.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import (

func analyseDataSourceFactory() map[string]domain.ExtractorFactory {
return map[string]domain.ExtractorFactory{
"postgres": infra.NewPostgresExtractorFactory(),
"postgres": infra.NewSQLExtractorFactory(),
"godror": infra.NewSQLExtractorFactory(),
"godror-raw": infra.NewSQLExtractorFactory(),
"mysql": infra.NewSQLExtractorFactory(),
"db2": infra.NewSQLExtractorFactory(),
}
}

Expand Down
12 changes: 6 additions & 6 deletions internal/infra/analyse/sql_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
"github.com/xo/dburl"
)

// PostgresExtractorFactory exposes methods to create new Postgres pullers.
type PostgresExtractorFactory struct{}
// SQLExtractorFactory exposes methods to create new Postgres pullers.
type SQLExtractorFactory struct{}

// NewPostgresExtractorFactory creates a new postgres datasource factory.
func NewPostgresExtractorFactory() *PostgresExtractorFactory {
return &PostgresExtractorFactory{}
// NewSQLExtractorFactory creates a new postgres datasource factory.
func NewSQLExtractorFactory() *SQLExtractorFactory {
return &SQLExtractorFactory{}
}

// SQLDataSource to read in the analyse process.
Expand Down Expand Up @@ -72,7 +72,7 @@ func (ds *SQLDataSource) ExtractValues(tableName string, columnName string) ([]i
return result, nil
}

func (e *PostgresExtractorFactory) New(url string, schema string) analyse.Extractor {
func (e *SQLExtractorFactory) New(url string, schema string) analyse.Extractor {
return &SQLDataSource{
url: url,
schema: schema,
Expand Down

0 comments on commit 5ef468e

Please sign in to comment.