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
- Variables
- func GetAbsPathOfPGCommand(cmd string) (string, error)
- func GetOracleConnectionString(host string, port int, dbname string, dbsid string, tnsalias string) string
- func IsTableEmpty(db *sql.DB, query string) bool
- type MySQL
- func (ms *MySQL) CheckRequiredToolsAreInstalled()
- func (ms *MySQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (ms *MySQL) Connect() error
- func (ms *MySQL) Disconnect()
- func (ms *MySQL) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, ...)
- func (ms *MySQL) ExportDataPostProcessing(exportDir string, ...)
- func (ms *MySQL) ExportSchema(exportDir string, schemaDir string)
- func (ms *MySQL) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (ms *MySQL) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (ms *MySQL) GetAllSequences() []string
- func (ms *MySQL) GetAllSequencesRaw(schemaName string) ([]string, error)
- func (ms *MySQL) GetAllTableNames() []*sqlname.SourceName
- func (ms *MySQL) GetAllTableNamesRaw(schemaName string) ([]string, error)
- func (ms *MySQL) GetCharset() (string, error)
- func (ms *MySQL) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string
- func (ms *MySQL) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, _ bool) (*utils.StructMap[sqlname.NameTuple, []string], ...)
- func (ms *MySQL) GetConnectionUriWithoutPassword() string
- func (ms *MySQL) GetIndexesInfo() []utils.IndexInfo
- func (ms *MySQL) GetNonPKTables() ([]string, error)
- func (ms *MySQL) GetPartitions(tableName sqlname.NameTuple) []string
- func (ms *MySQL) GetServers() []string
- func (ms *MySQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64
- func (ms *MySQL) GetTableRowCount(tableName sqlname.NameTuple) int64
- func (ms *MySQL) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)
- func (ms *MySQL) GetVersion() string
- func (ms *MySQL) ParentTableOfPartition(table sqlname.NameTuple) string
- func (ms *MySQL) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error
- type Ora2pgConfig
- type Oracle
- func (ora *Oracle) CheckRequiredToolsAreInstalled()
- func (ora *Oracle) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (ora *Oracle) Connect() error
- func (ora *Oracle) Disconnect()
- func (ora *Oracle) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, ...)
- func (ora *Oracle) ExportDataPostProcessing(exportDir string, ...)
- func (ora *Oracle) ExportSchema(exportDir string, schemaDir string)
- func (ora *Oracle) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (ora *Oracle) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (ora *Oracle) GetAllSequences() []string
- func (ora *Oracle) GetAllSequencesRaw(schemaName string) ([]string, error)
- func (ora *Oracle) GetAllTableNames() []*sqlname.SourceName
- func (ora *Oracle) GetAllTableNamesRaw(schemaName string) ([]string, error)
- func (ora *Oracle) GetCharset() (string, error)
- func (ora *Oracle) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string
- func (ora *Oracle) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], ...)
- func (ora *Oracle) GetConnectionUriWithoutPassword() string
- func (ora *Oracle) GetIndexesInfo() []utils.IndexInfo
- func (ora *Oracle) GetNonPKTables() ([]string, error)
- func (ora *Oracle) GetPartitions(tableName sqlname.NameTuple) []string
- func (ora *Oracle) GetServers() []string
- func (ora *Oracle) GetTableApproxRowCount(tableName sqlname.NameTuple) int64
- func (ora *Oracle) GetTableRowCount(tableName sqlname.NameTuple) int64
- func (ora *Oracle) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)
- func (ora *Oracle) GetTargetIdentityColumnSequenceName(sequenceName string) string
- func (ora *Oracle) GetVersion() string
- func (ora *Oracle) IsNestedTable(tableName sqlname.NameTuple) bool
- func (ora *Oracle) IsParentOfNestedTable(tableName sqlname.NameTuple) bool
- func (ora *Oracle) ParentTableOfPartition(table sqlname.NameTuple) string
- func (ora *Oracle) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error
- type PgDumpArgs
- type PostgreSQL
- func (pg *PostgreSQL) CheckRequiredToolsAreInstalled()
- func (pg *PostgreSQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (pg *PostgreSQL) Connect() error
- func (pg *PostgreSQL) CreateLogicalReplicationSlot(conn *pgconn.PgConn, replicationSlotName string, dropIfAlreadyExists bool) (*pglogrepl.CreateReplicationSlotResult, error)
- func (pg *PostgreSQL) CreatePublication(conn *pgconn.PgConn, publicationName string, tableList []sqlname.NameTuple, ...) error
- func (pg *PostgreSQL) Disconnect()
- func (pg *PostgreSQL) DropLogicalReplicationSlot(conn *pgconn.PgConn, replicationSlotName string) error
- func (pg *PostgreSQL) DropPublication(publicationName string) error
- func (pg *PostgreSQL) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, ...)
- func (pg *PostgreSQL) ExportDataPostProcessing(exportDir string, ...)
- func (pg *PostgreSQL) ExportSchema(exportDir string, schemaDir string)
- func (pg *PostgreSQL) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (pg *PostgreSQL) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (pg *PostgreSQL) GetAllSequences() []string
- func (pg *PostgreSQL) GetAllSequencesRaw(schemaName string) ([]string, error)
- func (pg *PostgreSQL) GetAllTableNames() []*sqlname.SourceName
- func (pg *PostgreSQL) GetAllTableNamesRaw(schemaName string) ([]string, error)
- func (pg *PostgreSQL) GetCharset() (string, error)
- func (pg *PostgreSQL) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string
- func (pg *PostgreSQL) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], ...)
- func (pg *PostgreSQL) GetConnectionUriWithoutPassword() string
- func (pg *PostgreSQL) GetIndexesInfo() []utils.IndexInfo
- func (pg *PostgreSQL) GetNonPKTables() ([]string, error)
- func (pg *PostgreSQL) GetPartitions(tableName sqlname.NameTuple) []string
- func (pg *PostgreSQL) GetReplicationConnection() (*pgconn.PgConn, error)
- func (pg *PostgreSQL) GetServers() []string
- func (pg *PostgreSQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64
- func (pg *PostgreSQL) GetTableRowCount(tableName sqlname.NameTuple) int64
- func (pg *PostgreSQL) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)
- func (pg *PostgreSQL) GetVersion() string
- func (pg *PostgreSQL) ParentTableOfPartition(table sqlname.NameTuple) string
- func (pg *PostgreSQL) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error
- type Source
- type SourceDB
- type YugabyteDB
- func (yb *YugabyteDB) CheckRequiredToolsAreInstalled()
- func (yb *YugabyteDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (yb *YugabyteDB) Connect() error
- func (yb *YugabyteDB) Disconnect()
- func (yb *YugabyteDB) ExportData(ctx context.Context, exportDir string, tableList []sqlname.NameTuple, ...)
- func (yb *YugabyteDB) ExportDataPostProcessing(exportDir string, ...)
- func (yb *YugabyteDB) ExportSchema(exportDir string, schemaDir string)
- func (yb *YugabyteDB) FilterEmptyTables(tableList []sqlname.NameTuple) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (yb *YugabyteDB) FilterUnsupportedTables(migrationUUID uuid.UUID, tableList []sqlname.NameTuple, useDebezium bool) ([]sqlname.NameTuple, []sqlname.NameTuple)
- func (yb *YugabyteDB) GetAllSequences() []string
- func (yb *YugabyteDB) GetAllSequencesRaw(schemaName string) ([]string, error)
- func (yb *YugabyteDB) GetAllTableNames() []*sqlname.SourceName
- func (yb *YugabyteDB) GetAllTableNamesRaw(schemaName string) ([]string, error)
- func (yb *YugabyteDB) GetCharset() (string, error)
- func (yb *YugabyteDB) GetColumnToSequenceMap(tableList []sqlname.NameTuple) map[string]string
- func (yb *YugabyteDB) GetColumnsWithSupportedTypes(tableList []sqlname.NameTuple, useDebezium bool, isStreamingEnabled bool) (*utils.StructMap[sqlname.NameTuple, []string], ...)
- func (yb *YugabyteDB) GetConnectionUriWithoutPassword() string
- func (yb *YugabyteDB) GetIndexesInfo() []utils.IndexInfo
- func (yb *YugabyteDB) GetNonPKTables() ([]string, error)
- func (yb *YugabyteDB) GetPartitions(tableName sqlname.NameTuple) []string
- func (yb *YugabyteDB) GetServers() []string
- func (yb *YugabyteDB) GetTableApproxRowCount(tableName sqlname.NameTuple) int64
- func (yb *YugabyteDB) GetTableRowCount(tableName sqlname.NameTuple) int64
- func (yb *YugabyteDB) GetTableToUniqueKeyColumnsMap(tableList []sqlname.NameTuple) (map[string][]string, error)
- func (yb *YugabyteDB) GetVersion() string
- func (yb *YugabyteDB) ParentTableOfPartition(table sqlname.NameTuple) string
- func (yb *YugabyteDB) ValidateTablesReadyForLiveMigration(tableList []sqlname.NameTuple) error
Constants ¶
const DROP_TABLE_IF_EXISTS_QUERY = `BEGIN
EXECUTE IMMEDIATE 'DROP TABLE %s ';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END;`
const FETCH_COLUMN_SEQUENCES_QUERY_TEMPLATE = `` /* 622-byte string literal not displayed */
const GET_TABLE_COLUMNS_QUERY_TEMPLATE_PG_AND_YB = `` /* 419-byte string literal not displayed */
const MYSQL_DATA_TYPE_MAPPING = "" /* 553-byte string literal not displayed */
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 ¶
var Ora2pgConfigFile string
var PG_COMMAND_VERSION = map[string]string{
"pg_dump": "14.0",
"pg_restore": "14.0",
"psql": "9.0",
}
var PG_QUERY_TO_CHECK_IF_TABLE_HAS_PK = `` /* 278-byte string literal not displayed */
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
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
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 (*MySQL) Disconnect ¶ added in v1.4.0
func (ms *MySQL) Disconnect()
func (*MySQL) ExportData ¶
func (*MySQL) ExportDataPostProcessing ¶
func (ms *MySQL) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)
func (*MySQL) ExportSchema ¶
func (*MySQL) FilterEmptyTables ¶ added in v1.3.0
func (*MySQL) FilterUnsupportedTables ¶ added in v0.83.0
func (*MySQL) GetAllSequences ¶ added in v1.4.0
func (*MySQL) GetAllSequencesRaw ¶ added in v1.7.0
func (*MySQL) GetAllTableNames ¶
func (ms *MySQL) GetAllTableNames() []*sqlname.SourceName
func (*MySQL) GetAllTableNamesRaw ¶ added in v1.7.0
func (*MySQL) GetCharset ¶ added in v0.81.0
func (*MySQL) GetColumnToSequenceMap ¶ added in v1.3.0
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 (*MySQL) GetConnectionUriWithoutPassword ¶ added in v1.7.0
func (*MySQL) GetIndexesInfo ¶ added in v1.6.0
func (*MySQL) GetNonPKTables ¶ added in v1.6.5
func (*MySQL) GetPartitions ¶ added in v1.6.0
func (*MySQL) GetServers ¶ added in v1.5.0
func (*MySQL) GetTableApproxRowCount ¶
func (*MySQL) GetTableRowCount ¶
func (*MySQL) GetTableToUniqueKeyColumnsMap ¶ added in v1.6.5
func (*MySQL) GetVersion ¶
func (*MySQL) ParentTableOfPartition ¶ added in v1.6.0
type Ora2pgConfig ¶ added in v1.1.0
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 (*Oracle) Disconnect ¶ added in v1.4.0
func (ora *Oracle) Disconnect()
func (*Oracle) ExportData ¶
func (*Oracle) ExportDataPostProcessing ¶
func (ora *Oracle) ExportDataPostProcessing(exportDir string, tablesProgressMetadata map[string]*utils.TableProgressMetadata)
func (*Oracle) ExportSchema ¶
func (*Oracle) FilterEmptyTables ¶ added in v1.3.0
func (*Oracle) FilterUnsupportedTables ¶ added in v0.83.0
func (*Oracle) GetAllSequences ¶ added in v1.4.0
func (*Oracle) GetAllSequencesRaw ¶ added in v1.7.0
func (*Oracle) GetAllTableNames ¶
func (ora *Oracle) GetAllTableNames() []*sqlname.SourceName
func (*Oracle) GetAllTableNamesRaw ¶ added in v1.7.0
func (*Oracle) GetCharset ¶ added in v0.81.0
func (*Oracle) GetColumnToSequenceMap ¶ added in v1.3.0
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 (*Oracle) GetConnectionUriWithoutPassword ¶ added in v1.7.0
func (*Oracle) GetIndexesInfo ¶ added in v1.6.0
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 (*Oracle) GetPartitions ¶ added in v1.6.0
func (*Oracle) GetServers ¶ added in v1.5.0
func (*Oracle) GetTableApproxRowCount ¶
func (*Oracle) GetTableRowCount ¶
func (*Oracle) GetTableToUniqueKeyColumnsMap ¶ added in v1.6.5
func (*Oracle) GetTargetIdentityColumnSequenceName ¶ added in v0.83.0
func (*Oracle) GetVersion ¶
func (*Oracle) IsNestedTable ¶ added in v1.3.0
func (*Oracle) IsParentOfNestedTable ¶ added in v1.3.0
func (*Oracle) ParentTableOfPartition ¶ added in v1.6.0
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 (*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 (*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 (*PostgreSQL) FilterUnsupportedTables ¶ added in v0.83.0
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 (*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 (*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) GetOracleHome ¶ added in v1.4.0
func (*Source) IsOracleCDBSetup ¶ added in v1.5.0
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 (*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 (*YugabyteDB) FilterUnsupportedTables ¶ added in v1.5.0
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 (*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 (*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