Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pkg import only once #1068

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
3 changes: 1 addition & 2 deletions driver/mysql/base/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package base
import (
"bytes"
"context"
gosql "database/sql"
"fmt"
"github.com/hashicorp/go-hclog"
"github.com/pingcap/tidb/types"
Expand Down Expand Up @@ -146,7 +145,7 @@ func ShowCreateTable(db usql.QueryAble, databaseName, tableName string) (stateme
return createTableStatement, err
}

func ShowCreateView(db *gosql.DB, databaseName, tableName string, dropTableIfExists bool) (createTableStatement string, err error) {
func ShowCreateView(db *sql.DB, databaseName, tableName string, dropTableIfExists bool) (createTableStatement string, err error) {
var dummy, character_set_client, collation_connection string
query := fmt.Sprintf(`show create table %s.%s`, umconf.EscapeName(databaseName), umconf.EscapeName(tableName))
err = db.QueryRow(query).Scan(&dummy, &createTableStatement, &character_set_client, &collation_connection)
Expand Down
3 changes: 1 addition & 2 deletions driver/mysql/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/actiontech/dtle/driver/common"

ubase "github.com/actiontech/dtle/driver/mysql/base"
uconf "github.com/actiontech/dtle/driver/mysql/mysqlconfig"
umconf "github.com/actiontech/dtle/driver/mysql/mysqlconfig"
usql "github.com/actiontech/dtle/driver/mysql/sql"
hclog "github.com/hashicorp/go-hclog"
Expand Down Expand Up @@ -101,7 +100,7 @@ func (i *Inspector) ValidateOriginalTable(databaseName, tableName string, table
return err
}
// TODO why assign OriginalTableColumns twice (later getSchemaTablesAndMeta->readTableColumns)?
table.ColumnMap, err = uconf.BuildColumnMapIndex(table.ColumnMapFrom, table.OriginalTableColumns.Ordinals)
table.ColumnMap, err = umconf.BuildColumnMapIndex(table.ColumnMapFrom, table.OriginalTableColumns.Ordinals)
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions driver/oracle/extractor/extractor_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package extractor
import (
"context"
"database/sql"
gosql "database/sql"
"encoding/binary"
"fmt"
"math"
Expand Down Expand Up @@ -61,8 +60,8 @@ type ExtractorOracle struct {

mysqlVersionDigit int
oracleDB *config.OracleDB
db *gosql.DB
singletonDB *gosql.DB
db *sql.DB
singletonDB *sql.DB
//dumpers []*mysql.dumper
// db.tb exists when creating the job, for full-copy.
// vs e.mysqlContext.ReplicateDoDb: all user assigned db.tb
Expand Down
3 changes: 1 addition & 2 deletions driver/oracle/extractor/log_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"crypto/md5"
"database/sql"
gosql "database/sql"
"encoding/hex"
"fmt"
"regexp"
Expand Down Expand Up @@ -1320,7 +1319,7 @@ func findTableConfig(schema *common.DataSource, tableName string) *common.Table
return loadTableConfig(schema, tableName)
}

func Query(db *gosql.DB, querySQL string, args ...interface{}) ([]map[string]string, error) {
func Query(db *sql.DB, querySQL string, args ...interface{}) ([]map[string]string, error) {
var (
cols []string
res []map[string]string
Expand Down