public

package
v1.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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.

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.

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.

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.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterCFGTable

func FilterCFGTable(cfg *config.Config, oracle *oracle.Oracle) ([]string, error)

func FilterOracleIncrRecord

func FilterOracleIncrRecord(
	lognimers []Logminer,
	syncSourceTables []string,
	exporterTableSourceSCN map[string]uint64,
	workerThreads, currentResetFlag int) (map[string][]Logminer, error)

按表级别筛选以及过滤数据

func IMigrate

func IMigrate(ex migrate.Migrator) error

func ParseSQL

func ParseSQL(sql string) (*ast.StmtNode, error)

Types

type Job

type Job struct {
	// contains filtered or unexported fields
}

func NewScheduleJob

func NewScheduleJob(size int, lcMap map[string][]Logminer, done func()) *Job

func (*Job) AddData

func (j *Job) AddData(data Logminer)

func (*Job) Close

func (j *Job) Close()

func (*Job) Schedule

func (j *Job) Schedule()

type Logminer

type Logminer struct {
	SCN          uint64
	SourceSchema string
	SourceTable  string
	TargetSchema string
	TargetTable  string
	SQLRedo      string
	SQLUndo      string
	Operation    string
}

获取 Oracle Logminer 日志内容并过滤筛选已提交的 INSERT/DELETE/UPDATE 事务语句 考虑异构数据库,只同步 INSERT/DELETE/UPDATE 事务语句以及 TRUNCATE TABLE/DROP TABLE DDL 语句,其他类型 SQL 不同步 V$LOGMNR_CONTENTS 字段解释参考链接 https://docs.oracle.com/en/database/oracle/oracle-database/21/refrn/V-LOGMNR_CONTENTS.html#GUID-B9196942-07BF-4935-B603-FA875064F5C3

func GetOracleIncrRecord

func GetOracleIncrRecord(ctx context.Context, oracle *oracle.Oracle, sourceSchema, targetSchema string, sourceTable string, tableNameRule map[string]string, lastCheckpoint string, queryTimeout int) ([]Logminer, error)

捕获增量数据

type Stmt

type Stmt struct {
	Schema    string
	Table     string
	Columns   []string
	Operation string
	Data      map[string]interface{}
	Before    map[string]interface{}
	WhereExpr string
}

func ExtractStmt

func ExtractStmt(rootNode *ast.StmtNode) *Stmt

func (*Stmt) Enter

func (v *Stmt) Enter(in ast.Node) (ast.Node, bool)

WARNING: sql parser Format() has be discrepancy ,be is instead of Restore()

func (*Stmt) Leave

func (v *Stmt) Leave(in ast.Node) (ast.Node, bool)

func (*Stmt) Marshal

func (v *Stmt) Marshal() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL