Documentation
¶
Overview ¶
Copyright © 2020 Marvin
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Copyright © 2020 Marvin ¶
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.
Index ¶
- func GenMySQLInsertSQLStmtPrefix(targetSchemaName, targetTableName string, columns []string, safeMode bool) string
- func GenMySQLPrepareBindVarStmt(columns, bindVarBatch int) string
- func GenMySQLTablePrepareStmt(targetSchemaName, targetTableName string, columnFields []string, ...) string
- func IApplier(r migrate.Applier) error
- func IExtractor(e migrate.Extractor) ([]string, []string, error)
- func ITranslator(t migrate.Translator) error
- type Chunk
- type IncrResult
- type IncrTask
- type Job
- type Migrate
- type Stmt
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenMySQLInsertSQLStmtPrefix ¶
func GenMySQLInsertSQLStmtPrefix(targetSchemaName, targetTableName string, columns []string, safeMode bool) string
SQL Prefix 语句
func GenMySQLPrepareBindVarStmt ¶
SQL Prepare 语句
func GenMySQLTablePrepareStmt ¶
func GenMySQLTablePrepareStmt( targetSchemaName, targetTableName string, columnFields []string, insertBatchSize int, safeMode bool) string
SQL Prepare 语句
func ITranslator ¶
func ITranslator(t migrate.Translator) error
Types ¶
type Chunk ¶
type Chunk struct {
Ctx context.Context
SyncMeta meta.FullSyncMeta
ApplyThreads int
BatchSize int
SafeMode bool
MySQL *mysql.MySQL
Oracle *oracle.Oracle
MetaDB *meta.Meta
SourceColumns []string
BatchResults []string
}
func (*Chunk) ApplyTableRows ¶
func (*Chunk) TranslateTableRows ¶
type IncrResult ¶
type IncrTask ¶
type IncrTask struct {
Ctx context.Context `json:"-"`
DBTypeS string `json:"db_type_s"`
DBTypeT string `json:"db_type_t"`
TaskMode string `json:"task_mode"`
GlobalSCN uint64 `json:"global_scn"`
SourceTableSCN uint64 `json:"source_table_scn"`
SourceSchema string `json:"source_schema"`
SourceTable string `json:"source_table"`
TargetSchema string `json:"target_schema"`
TargetTable string `json:"target_table"`
Operation string `json:"operation"`
OracleRedo string `json:"oracle_redo"` // Oracle SQL
MySQLRedo []string `json:"mysql_redo"` // MySQL 待执行 SQL
OperationType string `json:"operation_type"`
MySQL *mysql.MySQL `json:"-"`
MetaDB *meta.Meta `json:"-"`
}
type Migrate ¶ added in v1.0.8
type Migrate struct {
Ctx context.Context
Cfg *config.Config
Oracle *oracle.Oracle
Mysql *mysql.MySQL
MetaDB *meta.Meta
}
type Stmt ¶
type Stmt struct {
Schema string
Table string
Columns []string
Operation string
Data map[string]interface{}
Before map[string]interface{}
WhereExpr string
}