srcdb

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 34 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 FETCH_COLUMN_SEQUENCES_QUERY_TEMPLATE = `` /* 622-byte string literal not displayed */
View Source
const PG_COMMAND_VERSION string = "14.0"

Variables

View Source
var Ora2pgConfigFile string
View Source
var PG_QUERY_TO_CHECK_IF_TABLE_HAS_PK = `` /* 278-byte string literal not displayed */

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`.

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.SourceName, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList map[*sqlname.SourceName][]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)

func (*MySQL) FilterEmptyTables added in v1.3.0

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

func (*MySQL) FilterUnsupportedTables added in v0.83.0

func (ms *MySQL) FilterUnsupportedTables(tableList []*sqlname.SourceName, useDebezium bool) ([]*sqlname.SourceName, []*sqlname.SourceName)

func (*MySQL) GetAllSequences added in v1.4.0

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

func (*MySQL) GetAllTableNames

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

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.SourceName) 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.SourceName, useDebezium bool, _ bool) (map[*sqlname.SourceName][]string, []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.SourceName) []*sqlname.SourceName

func (*MySQL) GetServers added in v1.5.0

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

func (*MySQL) GetTableApproxRowCount

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

func (*MySQL) GetTableColumns added in v1.3.0

func (ms *MySQL) GetTableColumns(tableName *sqlname.SourceName) ([]string, []string, []string)

func (*MySQL) GetTableRowCount

func (ms *MySQL) GetTableRowCount(tableName string) int64

func (*MySQL) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (ms *MySQL) GetTableToUniqueKeyColumnsMap(tableList []*sqlname.SourceName) (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.SourceName) string

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
}

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.SourceName, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList map[*sqlname.SourceName][]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)

func (*Oracle) FilterEmptyTables added in v1.3.0

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

func (*Oracle) FilterUnsupportedTables added in v0.83.0

func (ora *Oracle) FilterUnsupportedTables(tableList []*sqlname.SourceName, useDebezium bool) ([]*sqlname.SourceName, []*sqlname.SourceName)

func (*Oracle) GetAllSequences added in v1.4.0

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

func (*Oracle) GetAllTableNames

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

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.SourceName) 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.SourceName, useDebezium bool, isStreamingEnabled bool) (map[*sqlname.SourceName][]string, []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.SourceName) []*sqlname.SourceName

func (*Oracle) GetServers added in v1.5.0

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

func (*Oracle) GetTableApproxRowCount

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

func (*Oracle) GetTableColumns added in v1.3.0

func (ora *Oracle) GetTableColumns(tableName *sqlname.SourceName) ([]string, []string, []string)

func (*Oracle) GetTableRowCount

func (ora *Oracle) GetTableRowCount(tableName string) int64

func (*Oracle) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (ora *Oracle) GetTableToUniqueKeyColumnsMap(tableList []*sqlname.SourceName) (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.SourceName) bool

func (*Oracle) IsParentOfNestedTable added in v1.3.0

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

func (*Oracle) ParentTableOfPartition added in v1.6.0

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

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.SourceName, dropIfAlreadyExists bool) 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.SourceName, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList map[*sqlname.SourceName][]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)

func (*PostgreSQL) FilterEmptyTables added in v1.3.0

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

func (*PostgreSQL) FilterUnsupportedTables added in v0.83.0

func (pg *PostgreSQL) FilterUnsupportedTables(tableList []*sqlname.SourceName, useDebezium bool) ([]*sqlname.SourceName, []*sqlname.SourceName)

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) GetAllTableNames

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

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.SourceName) map[string]string

func (*PostgreSQL) GetColumnsWithSupportedTypes added in v1.3.0

func (pg *PostgreSQL) GetColumnsWithSupportedTypes(tableList []*sqlname.SourceName, useDebezium bool, _ bool) (map[*sqlname.SourceName][]string, []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.SourceName) []*sqlname.SourceName

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.SourceName) int64

func (*PostgreSQL) GetTableColumns added in v1.3.0

func (pg *PostgreSQL) GetTableColumns(tableName *sqlname.SourceName) ([]string, []string, []string)

func (*PostgreSQL) GetTableRowCount

func (pg *PostgreSQL) GetTableRowCount(tableName string) int64

func (*PostgreSQL) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (pg *PostgreSQL) GetTableToUniqueKeyColumnsMap(tableList []*sqlname.SourceName) (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.SourceName) string

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()
	GetTableRowCount(tableName string) int64
	GetTableApproxRowCount(tableName *sqlname.SourceName) int64
	CheckRequiredToolsAreInstalled()
	GetVersion() string
	GetAllTableNames() []*sqlname.SourceName
	ExportSchema(exportDir string)
	GetIndexesInfo() []utils.IndexInfo
	ExportData(ctx context.Context, exportDir string, tableList []*sqlname.SourceName, quitChan chan bool, exportDataStart chan bool, exportSuccessChan chan bool, tablesColumnList map[*sqlname.SourceName][]string, snapshotName string)
	ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)
	GetCharset() (string, error)
	FilterUnsupportedTables(tableList []*sqlname.SourceName, useDebezium bool) ([]*sqlname.SourceName, []*sqlname.SourceName)
	FilterEmptyTables(tableList []*sqlname.SourceName) ([]*sqlname.SourceName, []*sqlname.SourceName)
	GetColumnsWithSupportedTypes(tableList []*sqlname.SourceName, useDebezium bool, isStreamingEnabled bool) (map[*sqlname.SourceName][]string, []string)
	GetTableColumns(tableName *sqlname.SourceName) ([]string, []string, []string)
	ParentTableOfPartition(table *sqlname.SourceName) string
	GetColumnToSequenceMap(tableList []*sqlname.SourceName) map[string]string
	GetAllSequences() []string
	GetServers() []string
	GetPartitions(table *sqlname.SourceName) []*sqlname.SourceName
	GetTableToUniqueKeyColumnsMap(tableList []*sqlname.SourceName) (map[string][]string, error)
	ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
	GetNonPKTables() ([]string, 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.SourceName, quitChan chan bool, exportDataStart, exportSuccessChan chan bool, tablesColumnList map[*sqlname.SourceName][]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)

func (*YugabyteDB) FilterEmptyTables added in v1.5.0

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

func (*YugabyteDB) FilterUnsupportedTables added in v1.5.0

func (yb *YugabyteDB) FilterUnsupportedTables(tableList []*sqlname.SourceName, useDebezium bool) ([]*sqlname.SourceName, []*sqlname.SourceName)

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) GetAllTableNames added in v1.5.0

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

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.SourceName) map[string]string

func (*YugabyteDB) GetColumnsWithSupportedTypes added in v1.5.0

func (yb *YugabyteDB) GetColumnsWithSupportedTypes(tableList []*sqlname.SourceName, useDebezium bool, _ bool) (map[*sqlname.SourceName][]string, []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.SourceName) []*sqlname.SourceName

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.SourceName) int64

func (*YugabyteDB) GetTableColumns added in v1.5.0

func (yb *YugabyteDB) GetTableColumns(tableName *sqlname.SourceName) ([]string, []string, []string)

func (*YugabyteDB) GetTableRowCount added in v1.5.0

func (yb *YugabyteDB) GetTableRowCount(tableName string) int64

func (*YugabyteDB) GetTableToUniqueKeyColumnsMap added in v1.6.5

func (yb *YugabyteDB) GetTableToUniqueKeyColumnsMap(tableList []*sqlname.SourceName) (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.SourceName) string

Jump to

Keyboard shortcuts

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