Skip to content

Commit

Permalink
feat: add license header
Browse files Browse the repository at this point in the history
  • Loading branch information
Breeze0806 committed Feb 12, 2024
1 parent fd39226 commit 35fdfed
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
3 changes: 0 additions & 3 deletions datax/plugin/reader/file/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ import (
"github.com/Breeze0806/go-etl/datax/common/plugin"
)


type Job struct {
*plugin.BaseJob
}


func NewJob() *Job {
return &Job{
plugin.NewBaseJob(),
}
}


func (j *Job) Destroy(ctx context.Context) (err error) {
return
}
4 changes: 0 additions & 4 deletions datax/plugin/writer/csv/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,22 @@ import (
"github.com/pingcap/errors"
)


type Job struct {
*file.Job
conf *Config
}


func NewJob() *Job {
return &Job{
Job: file.NewJob(),
}
}


func (j *Job) Init(ctx context.Context) (err error) {
j.conf, err = NewConfig(j.PluginJobConf())
return errors.Wrapf(err, "NewConfig fail. val: %v", j.PluginJobConf())
}


func (j *Job) Split(ctx context.Context, number int) (configs []*config.JSON, err error) {
for _, v := range j.conf.Path {
conf, _ := config.NewJSONFromString("{}")
Expand Down
14 changes: 6 additions & 8 deletions datax/plugin/writer/dbms/execer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,24 @@ import (
"github.com/Breeze0806/go-etl/storage/database"
)


type Execer interface {

Table(*database.BaseTable) database.Table
// Obtain relational database configuration through configuration
PingContext(ctx context.Context) error

QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
// BaseDbHandler Basic Database Execution Handler Encapsulation
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

FetchTableWithParam(ctx context.Context, param database.Parameter) (database.Table, error)

BatchExec(ctx context.Context, opts *database.ParameterOptions) (err error)
// NewBaseDbHandler Create a database execution handler encapsulation using the executor function newExecer and database transaction execution options opts
BatchExecStmt(ctx context.Context, opts *database.ParameterOptions) (err error)

BatchExecWithTx(ctx context.Context, opts *database.ParameterOptions) (err error)

BatchExecStmtWithTx(ctx context.Context, opts *database.ParameterOptions) (err error)

Close() error
}
3 changes: 0 additions & 3 deletions storage/database/mysql/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@
// The Scanner uses BaseScanner to simplify its implementation.
// The Valuer uses the implementation approach of GoValuer.




package mysql
14 changes: 14 additions & 0 deletions tools/datax/translate/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020 the go-etl Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
Expand Down

0 comments on commit 35fdfed

Please sign in to comment.