srcdb

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Copyright (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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 (c) YugabyteDB, Inc.

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

View Source
const DROP_TABLE_IF_EXISTS_QUERY = `BEGIN
EXECUTE IMMEDIATE 'DROP TABLE %s ';
EXCEPTION
WHEN OTHERS THEN
	IF SQLCODE != -942 THEN
		RAISE;
	END IF;
END;`
View Source
const FETCH_COLUMN_SEQUENCES_QUERY_TEMPLATE = `` /* 622-byte string literal not displayed */
View Source
const GET_TABLE_COLUMNS_QUERY_TEMPLATE_PG_AND_YB = `` /* 419-byte string literal not displayed */
View Source
const MYSQL_DATA_TYPE_MAPPING = "" /* 553-byte string literal not displayed */
View Source
const ORACLE_DATA_TYPE_MAPPING = "" /* 558-byte string literal not displayed */

These mappings are present as comment in sample-ora2pg.conf file as well, be sure to update at both the places.

Variables

View Source
var Ora2pgConfigFile string
View Source
var PG_COMMAND_VERSION = map[string]string{
	"pg_dump":    "14.0",
	"pg_restore": "14.0",
	"psql":       "9.0",
}
View Source
var PG_QUERY_TO_CHECK_IF_TABLE_HAS_PK = `` /* 278-byte string literal not displayed */
View Source
var PostgresUnsupportedDataTypesForDbzm = []string{"POINT", "LINE", "LSEG", "BOX", "PATH", "POLYGON", "CIRCLE", "GEOMETRY", "GEOGRAPHY", "RASTER", "PG_LSN", "TXID_SNAPSHOT"}

Functions

func GetAbsPathOfPGCommand added in v0.81.0

func GetAbsPathOfPGCommand(cmd string) (string, error)

Given a PG command name ("pg_dump", "pg_restore"), find absolute path of the executable file having version >= `PG_COMMAND_VERSION[cmd]`.

func GetOracleConnectionString added in v1.5.0

func GetOracleConnectionString(host string, port int, dbname string, dbsid string, tnsalias string) string

func IsTableEmpty added in v1.3.0

func IsTableEmpty(db *sql.DB, query string) bool

Types

type MySQL

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

func (*MySQL) CheckRequiredToolsAreInstalled

func (ms *MySQL) CheckRequiredToolsAreInstalled()

func (*MySQL) ClearMigrationState added in v1.6.0

func (ms *MySQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error

func (*MySQL) Connect

func (ms *MySQL) Connect() error

func (*MySQL) Disconnect added in v1.4.0

func (ms *MySQL) Disconnect()

func (*MySQL) ExportData

func (ms *MySQL) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList *utils.StructMap[sqlname.NameTuple, []string], snapshotName string)

func (*MySQL) ExportDataPostProcessing

func (ms *MySQL) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)

func (*MySQL) ExportSchema

func (ms *MySQL) ExportSchema(exportDir string, schemaDir string)

func (*MySQL) FilterEmptyTables added in v1.3.0

func (ms *MySQL) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*MySQL) FilterUnsupportedTables added in v0.83.0

func (ms *MySQL) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*MySQL) GetAllSequences added in v1.4.0

func (ms *MySQL) GetAllSequences() []string

func (*MySQL) GetAllSequencesRaw added in v1.7.0

func (ms *MySQL) GetAllSequencesRaw(schemaName string) ([]string, error)

func (*MySQL) GetAllTableNames

func (ms *MySQL) GetAllTableNames() []*sqlname.SourceName

func (*MySQL) GetAllTableNamesRaw added in v1.7.0

func (ms *MySQL) GetAllTableNamesRaw(schemaName string) ([]string, error)

func (*MySQL) GetCharset added in v0.81.0

func (ms *MySQL) GetCharset() (string, error)

func (*MySQL) GetColumnToSequenceMap added in v1.3.0

func (ms *MySQL) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string

Only valid case is when the table has a auto increment column Note: a mysql table can have only one auto increment column

func (*MySQL) GetColumnsWithSupportedTypes added in v1.3.0

func (ms *MySQL) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, _ bool) (*utils.StructMap[sqlname.NameTuple, []string], *utils.StructMap[sqlname.NameTuple, []string], error)

func (*MySQL) GetConnectionUriWithoutPassword added in v1.7.0

func (ms *MySQL) GetConnectionUriWithoutPassword() string

func (*MySQL) GetIndexesInfo added in v1.6.0

func (ms *MySQL) GetIndexesInfo() []utils.IndexInfo

func (*MySQL) GetNonPKTables added in v1.6.5

func (ms *MySQL) GetNonPKTables() ([]string, error)

func (*MySQL) GetPartitions added in v1.6.0

func (ms *MySQL) GetPartitions(tableName sqlname.NameTuple) []string

func (*MySQL) GetServers added in v1.5.0

func (ms *MySQL) GetServers() []string

func (*MySQL) GetTableApproxRowCount

func (ms *MySQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64

func (*MySQL) GetTableRowCount

func (ms *MySQL) GetTableRowCount(tableName sqlname.NameTuple) int64

func (*MySQL) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (ms *MySQL) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)

func (*MySQL) GetVersion

func (ms *MySQL) GetVersion() string

func (*MySQL) ParentTableOfPartition added in v1.6.0

func (ms *MySQL) ParentTableOfPartition(table sqlname.NameTuple) string

func (*MySQL) ValidateTablesReadyForLiveMigration added in v1.7.0

func (ms *MySQL) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error

type Ora2pgConfig added in v1.1.0

type Ora2pgConfig struct {
	OracleDSN        string
	OracleUser       string
	OracleHome       string
	OraclePWD        string
	Schema           string
	ParallelTables   string
	UseOrafce        string
	DisablePartition string
	DisableComment   string
	Allow            string
	ModifyStruct     string
	DataTypeMapping  string
}

type Oracle

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

func (*Oracle) CheckRequiredToolsAreInstalled

func (ora *Oracle) CheckRequiredToolsAreInstalled()

func (*Oracle) ClearMigrationState added in v1.6.0

func (ora *Oracle) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error

func (*Oracle) Connect

func (ora *Oracle) Connect() error

func (*Oracle) Disconnect added in v1.4.0

func (ora *Oracle) Disconnect()

func (*Oracle) ExportData

func (ora *Oracle) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList *utils.StructMap[sqlname.NameTuple, []string], snapshotName string)

func (*Oracle) ExportDataPostProcessing

func (ora *Oracle) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)

func (*Oracle) ExportSchema

func (ora *Oracle) ExportSchema(exportDir string, schemaDir string)

func (*Oracle) FilterEmptyTables added in v1.3.0

func (ora *Oracle) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*Oracle) FilterUnsupportedTables added in v0.83.0

func (ora *Oracle) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*Oracle) GetAllSequences added in v1.4.0

func (ora *Oracle) GetAllSequences() []string

func (*Oracle) GetAllSequencesRaw added in v1.7.0

func (ora *Oracle) GetAllSequencesRaw(schemaName string) ([]string, error)

func (*Oracle) GetAllTableNames

func (ora *Oracle) GetAllTableNames() []*sqlname.SourceName

func (*Oracle) GetAllTableNamesRaw added in v1.7.0

func (ora *Oracle) GetAllTableNamesRaw(schemaName string) ([]string, error)

func (*Oracle) GetCharset added in v0.81.0

func (ora *Oracle) GetCharset() (string, error)

func (*Oracle) GetColumnToSequenceMap added in v1.3.0

func (ora *Oracle) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string

GetColumnToSequenceMap returns a map of column name to sequence name for all identity columns in the given list of tables. Note: There can be only one identity column per table in Oracle

func (*Oracle) GetColumnsWithSupportedTypes added in v1.3.0

func (ora *Oracle) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], *utils.StructMap[sqlname.NameTuple, []string], error)

func (*Oracle) GetConnectionUriWithoutPassword added in v1.7.0

func (ora *Oracle) GetConnectionUriWithoutPassword() string

func (*Oracle) GetIndexesInfo added in v1.6.0

func (ora *Oracle) GetIndexesInfo() []utils.IndexInfo

return list of jsons having index info like index name, index type, table name, column name

func (*Oracle) GetNonPKTables added in v1.6.5

func (ora *Oracle) GetNonPKTables() ([]string, error)

func (*Oracle) GetPartitions added in v1.6.0

func (ora *Oracle) GetPartitions(tableName sqlname.NameTuple) []string

func (*Oracle) GetServers added in v1.5.0

func (ora *Oracle) GetServers() []string

func (*Oracle) GetTableApproxRowCount

func (ora *Oracle) GetTableApproxRowCount(tableName sqlname.NameTuple) int64

func (*Oracle) GetTableRowCount

func (ora *Oracle) GetTableRowCount(tableName sqlname.NameTuple) int64

func (*Oracle) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (ora *Oracle) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)

func (*Oracle) GetTargetIdentityColumnSequenceName added in v0.83.0

func (ora *Oracle) GetTargetIdentityColumnSequenceName(sequenceName string) string

func (*Oracle) GetVersion

func (ora *Oracle) GetVersion() string

func (*Oracle) IsNestedTable added in v1.3.0

func (ora *Oracle) IsNestedTable(tableName sqlname.NameTuple) bool

func (*Oracle) IsParentOfNestedTable added in v1.3.0

func (ora *Oracle) IsParentOfNestedTable(tableName sqlname.NameTuple) bool

func (*Oracle) ParentTableOfPartition added in v1.6.0

func (ora *Oracle) ParentTableOfPartition(table sqlname.NameTuple) string

func (*Oracle) ValidateTablesReadyForLiveMigration added in v1.7.0

func (ora *Oracle) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error

type PgDumpArgs added in v1.5.0

type PgDumpArgs struct {
	Schema             string
	SchemaTempFilePath string
	ExtensionPattern   string
	TablesListPattern  string
	DataDirPath        string
	DataFormat         string
	ParallelJobs       string
	NoComments         string

	// default values from template file will be taken
	SchemaOnly           string
	NoOwner              string
	NoPrivileges         string
	NoTablespaces        string
	LoadViaPartitionRoot string
	DataOnly             string
	NoBlobs              string
}

type PostgreSQL

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

func (*PostgreSQL) CheckRequiredToolsAreInstalled

func (pg *PostgreSQL) CheckRequiredToolsAreInstalled()

func (*PostgreSQL) ClearMigrationState added in v1.6.0

func (pg *PostgreSQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error

func (*PostgreSQL) Connect

func (pg *PostgreSQL) Connect() error

func (*PostgreSQL) CreateLogicalReplicationSlot added in v1.6.2

func (pg *PostgreSQL) CreateLogicalReplicationSlot(conn *pgconn.PgConn, replicationSlotName string, dropIfAlreadyExists bool) (*pglogrepl.CreateReplicationSlotResult, error)

func (*PostgreSQL) CreatePublication added in v1.6.5

func (pg *PostgreSQL) CreatePublication(conn *pgconn.PgConn, publicationName string, tableList []sqlname.NameTuple, dropIfAlreadyExists bool, leafPartitions *utils.StructMap[sqlname.NameTuple, []string]) error

func (*PostgreSQL) Disconnect added in v1.4.0

func (pg *PostgreSQL) Disconnect()

func (*PostgreSQL) DropLogicalReplicationSlot added in v1.6.5

func (pg *PostgreSQL) DropLogicalReplicationSlot(conn *pgconn.PgConn, replicationSlotName string) error

func (*PostgreSQL) DropPublication added in v1.6.5

func (pg *PostgreSQL) DropPublication(publicationName string) error

func (*PostgreSQL) ExportData

func (pg *PostgreSQL) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList *utils.StructMap[sqlname.NameTuple, []string], snapshotName string)

func (*PostgreSQL) ExportDataPostProcessing

func (pg *PostgreSQL) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)

func (*PostgreSQL) ExportSchema

func (pg *PostgreSQL) ExportSchema(exportDir string, schemaDir string)

func (*PostgreSQL) FilterEmptyTables added in v1.3.0

func (pg *PostgreSQL) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*PostgreSQL) FilterUnsupportedTables added in v0.83.0

func (pg *PostgreSQL) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*PostgreSQL) GetAllSequences added in v1.4.0

func (pg *PostgreSQL) GetAllSequences() []string

GetAllSequences returns all the sequence names in the database for the given schema list

func (*PostgreSQL) GetAllSequencesRaw added in v1.7.0

func (pg *PostgreSQL) GetAllSequencesRaw(schemaName string) ([]string, error)

GetAllSequencesRaw returns all the sequence names in the database for the schema

func (*PostgreSQL) GetAllTableNames

func (pg *PostgreSQL) GetAllTableNames() []*sqlname.SourceName

func (*PostgreSQL) GetAllTableNamesRaw added in v1.7.0

func (pg *PostgreSQL) GetAllTableNamesRaw(schemaName string) ([]string, error)

func (*PostgreSQL) GetCharset added in v0.81.0

func (pg *PostgreSQL) GetCharset() (string, error)

func (*PostgreSQL) GetColumnToSequenceMap added in v1.3.0

func (pg *PostgreSQL) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string

func (*PostgreSQL) GetColumnsWithSupportedTypes added in v1.3.0

func (pg *PostgreSQL) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], *utils.StructMap[sqlname.NameTuple, []string], error)

func (*PostgreSQL) GetConnectionUriWithoutPassword added in v1.7.0

func (pg *PostgreSQL) GetConnectionUriWithoutPassword() string

func (*PostgreSQL) GetIndexesInfo added in v1.6.0

func (pg *PostgreSQL) GetIndexesInfo() []utils.IndexInfo

func (*PostgreSQL) GetNonPKTables added in v1.6.5

func (pg *PostgreSQL) GetNonPKTables() ([]string, error)

func (*PostgreSQL) GetPartitions added in v1.6.0

func (pg *PostgreSQL) GetPartitions(tableName sqlname.NameTuple) []string

func (*PostgreSQL) GetReplicationConnection added in v1.6.2

func (pg *PostgreSQL) GetReplicationConnection() (*pgconn.PgConn, error)

func (*PostgreSQL) GetServers added in v1.5.0

func (pg *PostgreSQL) GetServers() []string

func (*PostgreSQL) GetTableApproxRowCount

func (pg *PostgreSQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64

func (*PostgreSQL) GetTableRowCount

func (pg *PostgreSQL) GetTableRowCount(tableName sqlname.NameTuple) int64

func (*PostgreSQL) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (pg *PostgreSQL) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)

func (*PostgreSQL) GetVersion

func (pg *PostgreSQL) GetVersion() string

func (*PostgreSQL) ParentTableOfPartition added in v1.6.0

func (pg *PostgreSQL) ParentTableOfPartition(table sqlname.NameTuple) string

func (*PostgreSQL) ValidateTablesReadyForLiveMigration added in v1.7.0

func (pg *PostgreSQL) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error

type Source

type Source struct {
	DBType                   string        `json:"db_type"`
	Host                     string        `json:"host"`
	Port                     int           `json:"port"`
	User                     string        `json:"user"`
	Password                 string        `json:"password"`
	DBName                   string        `json:"db_name"`
	CDBName                  string        `json:"cdb_name"`
	DBSid                    string        `json:"db_sid"`
	CDBSid                   string        `json:"cdb_sid"`
	OracleHome               string        `json:"oracle_home"`
	TNSAlias                 string        `json:"tns_alias"`
	CDBTNSAlias              string        `json:"cdb_tns_alias"`
	Schema                   string        `json:"schema"`
	SSLMode                  string        `json:"ssl_mode"`
	SSLCertPath              string        `json:"ssl_cert_path"`
	SSLKey                   string        `json:"ssl_key"`
	SSLRootCert              string        `json:"ssl_root_cert"`
	SSLCRL                   string        `json:"ssl_crl"`
	SSLQueryString           string        `json:"ssl_query_string"`
	SSLKeyStore              string        `json:"ssl_keystore"`
	SSLKeyStorePassword      string        `json:"ssl_keystore_password"`
	SSLTrustStore            string        `json:"ssl_truststore"`
	SSLTrustStorePassword    string        `json:"ssl_truststore_password"`
	Uri                      string        `json:"uri"`
	NumConnections           int           `json:"num_connections"`
	TableList                string        `json:"table_list"`
	ExcludeTableList         string        `json:"exclude_table_list"`
	UseOrafce                utils.BoolStr `json:"use_orafce"`
	CommentsOnObjects        utils.BoolStr `json:"comments_on_objects"`
	DBVersion                string        `json:"db_version"`
	StrExportObjectTypeList  string        `json:"str_export_object_type_list"`
	StrExcludeObjectTypeList string        `json:"str_exclude_object_type_list"`

	ExportObjectTypeList []string `json:"-"`
	// contains filtered or unexported fields
}

func (*Source) ApplyExportSchemaObjectListFilter added in v1.6.0

func (s *Source) ApplyExportSchemaObjectListFilter()

func (*Source) Clone added in v1.6.0

func (s *Source) Clone() *Source

func (*Source) DB

func (s *Source) DB() SourceDB

func (*Source) GetOracleHome added in v1.4.0

func (s *Source) GetOracleHome() string

func (*Source) IsOracleCDBSetup added in v1.5.0

func (s *Source) IsOracleCDBSetup() bool

type SourceDB

type SourceDB interface {
	Connect() error
	Disconnect()
	GetConnectionUriWithoutPassword() string
	GetTableRowCount(tableName sqlname.NameTuple) int64
	GetTableApproxRowCount(tableName sqlname.NameTuple) int64
	CheckRequiredToolsAreInstalled()
	GetVersion() string
	GetAllTableNames() []*sqlname.SourceName
	GetAllTableNamesRaw(schemaName string) ([]string, error)
	GetAllSequencesRaw(schemaName string) ([]string, error)
	ExportSchema(exportDir string, schemaDir string)
	GetIndexesInfo() []utils.IndexInfo
	ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, quitChan chan bool, exportDataStart chan bool, exportSuccessChan chan bool, tablesColumnList *utils.StructMap[sqlname.NameTuple, []string], snapshotName string)
	ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)
	GetCharset() (string, error)
	FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)
	FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)
	GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], *utils.StructMap[sqlname.NameTuple, []string], error)
	ParentTableOfPartition(table sqlname.NameTuple) string
	GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string
	GetAllSequences() []string
	GetServers() []string
	GetPartitions(table sqlname.NameTuple) []string
	GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)
	ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
	GetNonPKTables() ([]string, error)
	ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error
}

type YugabyteDB added in v1.5.0

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

func (*YugabyteDB) CheckRequiredToolsAreInstalled added in v1.5.0

func (yb *YugabyteDB) CheckRequiredToolsAreInstalled()

func (*YugabyteDB) ClearMigrationState added in v1.6.0

func (yb *YugabyteDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error

func (*YugabyteDB) Connect added in v1.5.0

func (yb *YugabyteDB) Connect() error

func (*YugabyteDB) Disconnect added in v1.5.0

func (yb *YugabyteDB) Disconnect()

func (*YugabyteDB) ExportData added in v1.5.0

func (yb *YugabyteDB) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList *utils.StructMap[sqlname.NameTuple, []string], snapshotName string)

func (*YugabyteDB) ExportDataPostProcessing added in v1.5.0

func (yb *YugabyteDB) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)

func (*YugabyteDB) ExportSchema added in v1.5.0

func (yb *YugabyteDB) ExportSchema(exportDir string, schemaDir string)

func (*YugabyteDB) FilterEmptyTables added in v1.5.0

func (yb *YugabyteDB) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*YugabyteDB) FilterUnsupportedTables added in v1.5.0

func (yb *YugabyteDB) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)

func (*YugabyteDB) GetAllSequences added in v1.5.0

func (yb *YugabyteDB) GetAllSequences() []string

GetAllSequences returns all the sequence names in the database for the given schema list

func (*YugabyteDB) GetAllSequencesRaw added in v1.7.0

func (yb *YugabyteDB) GetAllSequencesRaw(schemaName string) ([]string, error)

GetAllSequencesRaw returns all the sequence names in the database for the schema

func (*YugabyteDB) GetAllTableNames added in v1.5.0

func (yb *YugabyteDB) GetAllTableNames() []*sqlname.SourceName

func (*YugabyteDB) GetAllTableNamesRaw added in v1.7.0

func (yb *YugabyteDB) GetAllTableNamesRaw(schemaName string) ([]string, error)

func (*YugabyteDB) GetCharset added in v1.5.0

func (yb *YugabyteDB) GetCharset() (string, error)

func (*YugabyteDB) GetColumnToSequenceMap added in v1.5.0

func (yb *YugabyteDB) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string

func (*YugabyteDB) GetColumnsWithSupportedTypes added in v1.5.0

func (yb *YugabyteDB) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], *utils.StructMap[sqlname.NameTuple, []string], error)

func (*YugabyteDB) GetConnectionUriWithoutPassword added in v1.7.0

func (yb *YugabyteDB) GetConnectionUriWithoutPassword() string

func (*YugabyteDB) GetIndexesInfo added in v1.6.0

func (yb *YugabyteDB) GetIndexesInfo() []utils.IndexInfo

func (*YugabyteDB) GetNonPKTables added in v1.6.5

func (yb *YugabyteDB) GetNonPKTables() ([]string, error)

func (*YugabyteDB) GetPartitions added in v1.6.0

func (yb *YugabyteDB) GetPartitions(tableName sqlname.NameTuple) []string

func (*YugabyteDB) GetServers added in v1.5.0

func (yb *YugabyteDB) GetServers() []string

func (*YugabyteDB) GetTableApproxRowCount added in v1.5.0

func (yb *YugabyteDB) GetTableApproxRowCount(tableName sqlname.NameTuple) int64

func (*YugabyteDB) GetTableRowCount added in v1.5.0

func (yb *YugabyteDB) GetTableRowCount(tableName sqlname.NameTuple) int64

func (*YugabyteDB) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (yb *YugabyteDB) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)

func (*YugabyteDB) GetVersion added in v1.5.0

func (yb *YugabyteDB) GetVersion() string

func (*YugabyteDB) ParentTableOfPartition added in v1.6.0

func (yb *YugabyteDB) ParentTableOfPartition(table sqlname.NameTuple) string

func (*YugabyteDB) ValidateTablesReadyForLiveMigration added in v1.7.0

func (yb *YugabyteDB) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error

Jump to

Keyboard shortcuts

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