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.
Index ¶
- Constants
- Variables
- type AttributeNameRegistry
- type Batch
- type ConnectionParams
- type ConnectionPool
- type Event
- func (e *Event) Copy() *Event
- func (e *Event) GetParams() []interface{}
- func (e *Event) GetPreparedSQLStmt(tdb TargetDB, targetDBType string) (string, error)
- func (event *Event) GetPreparedStmtName() string
- func (e *Event) GetSQLStmt(tdb TargetDB) (string, error)
- func (e *Event) IsCutoverEvent() bool
- func (e *Event) IsCutoverToSource() bool
- func (e *Event) IsCutoverToSourceReplica() bool
- func (e *Event) IsCutoverToTarget() bool
- func (event *Event) IsUniqueKeyChanged(uniqueKeyCols []string) bool
- func (e *Event) String() string
- func (e *Event) UnmarshalJSON(data []byte) error
- type EventBatch
- func (eb *EventBatch) GetChannelMetadataUpdateQuery(migrationUUID uuid.UUID) string
- func (eb *EventBatch) GetLastVsn() int64
- func (eb *EventBatch) GetQueriesToInsertEventStatsByTable(migrationUUID uuid.UUID, tableNameTup sqlname.NameTuple) string
- func (eb *EventBatch) GetQueriesToUpdateEventStatsByTable(migrationUUID uuid.UUID, tableNameTup sqlname.NameTuple) string
- func (eb *EventBatch) GetTableNames() []sqlname.NameTuple
- func (eb *EventBatch) ID() string
- type EventCounter
- type ImportBatchArgs
- type TargetConf
- type TargetDB
- type TargetOracleDB
- func (tdb *TargetOracleDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (tdb *TargetOracleDB) CreateVoyagerSchema() error
- func (tdb *TargetOracleDB) DisableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (tdb *TargetOracleDB) EnableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (tdb *TargetOracleDB) EnableGeneratedByDefaultAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (tdb *TargetOracleDB) Exec(query string) (int64, error)
- func (tdb *TargetOracleDB) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
- func (tdb *TargetOracleDB) Finalize()
- func (tdb *TargetOracleDB) GetConnection() *sql.Conn
- func (tdb *TargetOracleDB) GetIdentityColumnNamesForTable(tableNameTup sqlname.NameTuple, identityType string) ([]string, error)
- func (tdb *TargetOracleDB) GetListOfTableAttributes(tableNameTup sqlname.NameTuple) ([]string, error)
- func (tdb *TargetOracleDB) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
- func (tdb *TargetOracleDB) GetVersion() string
- func (tdb *TargetOracleDB) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, ...) (int64, error)
- func (tdb *TargetOracleDB) Init() error
- func (tdb *TargetOracleDB) InitConnPool() error
- func (tdb *TargetOracleDB) InvalidIndexes() (map[string]bool, error)
- func (tdb *TargetOracleDB) IsNonRetryableCopyError(err error) bool
- func (tdb *TargetOracleDB) MaxBatchSizeInBytes() int64
- func (tdb *TargetOracleDB) PrepareForStreaming()
- func (tdb *TargetOracleDB) Query(query string) (*sql.Rows, error)
- func (tdb *TargetOracleDB) QueryRow(query string) *sql.Row
- func (tdb *TargetOracleDB) RestoreSequences(sequencesLastVal map[string]int64) error
- func (tdb *TargetOracleDB) WithConnFromPool(fn func(*sql.Conn) (bool, error)) error
- func (tdb *TargetOracleDB) WithTx(fn func(tx *sql.Tx) error) error
- type TargetPostgreSQL
- func (pg *TargetPostgreSQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (pg *TargetPostgreSQL) CreateVoyagerSchema() error
- func (pg *TargetPostgreSQL) DisableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (pg *TargetPostgreSQL) EnableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (pg *TargetPostgreSQL) EnableGeneratedByDefaultAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (pg *TargetPostgreSQL) EnsureConnected()
- func (pg *TargetPostgreSQL) Exec(query string) (int64, error)
- func (pg *TargetPostgreSQL) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
- func (pg *TargetPostgreSQL) Finalize()
- func (pg *TargetPostgreSQL) GetIdentityColumnNamesForTable(tableNameTup sqlname.NameTuple, identityType string) ([]string, error)
- func (pg *TargetPostgreSQL) GetListOfTableAttributes(nt sqlname.NameTuple) ([]string, error)
- func (pg *TargetPostgreSQL) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
- func (pg *TargetPostgreSQL) GetVersion() string
- func (pg *TargetPostgreSQL) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, ...) (int64, error)
- func (pg *TargetPostgreSQL) Init() error
- func (pg *TargetPostgreSQL) InitConnPool() error
- func (pg *TargetPostgreSQL) InvalidIndexes() (map[string]bool, error)
- func (pg *TargetPostgreSQL) IsNonRetryableCopyError(err error) bool
- func (pg *TargetPostgreSQL) MaxBatchSizeInBytes() int64
- func (pg *TargetPostgreSQL) PrepareForStreaming()
- func (pg *TargetPostgreSQL) Query(query string) (*sql.Rows, error)
- func (pg *TargetPostgreSQL) QueryRow(query string) *sql.Row
- func (pg *TargetPostgreSQL) RestoreSequences(sequencesLastVal map[string]int64) error
- func (pg *TargetPostgreSQL) WithTx(fn func(tx *sql.Tx) error) error
- type TargetYugabyteDB
- func (yb *TargetYugabyteDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
- func (yb *TargetYugabyteDB) CreateVoyagerSchema() error
- func (yb *TargetYugabyteDB) DisableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (yb *TargetYugabyteDB) EnableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (yb *TargetYugabyteDB) EnableGeneratedByDefaultAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error
- func (yb *TargetYugabyteDB) EnsureConnected()
- func (yb *TargetYugabyteDB) Exec(query string) (int64, error)
- func (yb *TargetYugabyteDB) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
- func (yb *TargetYugabyteDB) Finalize()
- func (yb *TargetYugabyteDB) GetAllSchemaNamesRaw() ([]string, error)
- func (yb *TargetYugabyteDB) GetAllSequencesRaw(schemaName string) ([]string, error)
- func (yb *TargetYugabyteDB) GetAllTableNamesRaw(schemaName string) ([]string, error)
- func (yb *TargetYugabyteDB) GetIdentityColumnNamesForTable(tableNameTup sqlname.NameTuple, identityType string) ([]string, error)
- func (yb *TargetYugabyteDB) GetListOfTableAttributes(nt sqlname.NameTuple) ([]string, error)
- func (yb *TargetYugabyteDB) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
- func (yb *TargetYugabyteDB) GetVersion() string
- func (yb *TargetYugabyteDB) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, ...) (int64, error)
- func (yb *TargetYugabyteDB) Init() error
- func (yb *TargetYugabyteDB) InitConnPool() error
- func (yb *TargetYugabyteDB) InvalidIndexes() (map[string]bool, error)
- func (yb *TargetYugabyteDB) IsNonRetryableCopyError(err error) bool
- func (yb *TargetYugabyteDB) MaxBatchSizeInBytes() int64
- func (yb *TargetYugabyteDB) PrepareForStreaming()
- func (yb *TargetYugabyteDB) Query(query string) (*sql.Rows, error)
- func (yb *TargetYugabyteDB) QueryRow(query string) *sql.Row
- func (yb *TargetYugabyteDB) RestoreSequences(sequencesLastVal map[string]int64) error
- func (yb *TargetYugabyteDB) WithTx(fn func(tx *sql.Tx) error) error
Constants ¶
const ( ORACLE = "oracle" MYSQL = "mysql" POSTGRESQL = "postgresql" YUGABYTEDB = "yugabytedb" )
const ( LB_WARN_MSG = "--target-db-host is a load balancer IP which will be used to create connections for data import.\n" + "\t To control the parallelism and servers used, refer to help for --parallel-jobs and --target-endpoints flags.\n" GET_YB_SERVERS_QUERY = "SELECT host, port, num_connections, node_type, cloud, region, zone, public_ip FROM yb_servers()" )
const ( SET_CLIENT_ENCODING_TO_UTF8 = "SET client_encoding TO 'UTF8'" SET_SESSION_REPLICATE_ROLE_TO_REPLICA = "SET session_replication_role TO replica" //Disable triggers or fkeys constraint checks. SET_YB_ENABLE_UPSERT_MODE = "SET yb_enable_upsert_mode to true" SET_YB_DISABLE_TRANSACTIONAL_WRITES = "SET yb_disable_transactional_writes to true" // Disable transactions to improve ingestion throughput. // The "SELECT 1" workaround introduced in ExecuteBatch does not work if isolation level is read_committed. Therefore, for now, we are forcing REPEATABLE READ. SET_DEFAULT_ISOLATION_LEVEL_REPEATABLE_READ = "SET default_transaction_isolation = 'repeatable read'" ERROR_MSG_PERMISSION_DENIED = "permission denied" )
import session parameters
const ALTER_QUERY_RETRY_COUNT = 5
const BATCH_METADATA_TABLE_NAME = BATCH_METADATA_TABLE_SCHEMA + "." + "ybvoyager_import_data_batches_metainfo_v3"
const BATCH_METADATA_TABLE_SCHEMA = "ybvoyager_metadata"
The _v2 is appended in the table name so that the import code doesn't try to use the similar table created by the voyager 1.3 and earlier. Voyager 1.4 uses import data state format that is incompatible from the earlier versions.
const EVENTS_PER_TABLE_METADATA_TABLE_NAME = BATCH_METADATA_TABLE_SCHEMA + "." + "ybvoyager_imported_event_count_by_table"
const EVENT_CHANNELS_METADATA_TABLE_NAME = BATCH_METADATA_TABLE_SCHEMA + "." + "ybvoyager_import_data_event_channels_metainfo"
const PG_DEFAULT_PARALLELISM_FACTOR = 8 // factor for default parallelism in case fetchDefaultParallelJobs() is not able to get the no of cores
const YB_DEFAULT_PARALLELISM_FACTOR = 2 // factor for default parallelism in case fetchDefaultParallelJobs() is not able to get the no of cores
Variables ¶
var NonRetryCopyErrors = []string{
"invalid input syntax",
"violates unique constraint",
"syntax error at",
}
Functions ¶
This section is empty.
Types ¶
type AttributeNameRegistry ¶ added in v1.7.0
type AttributeNameRegistry struct {
// contains filtered or unexported fields
}
func NewAttributeNameRegistry ¶ added in v1.7.0
func NewAttributeNameRegistry(tdb TargetDB, tconf *TargetConf) *AttributeNameRegistry
func (*AttributeNameRegistry) QuoteAttributeName ¶ added in v1.7.0
func (*AttributeNameRegistry) QuoteAttributeNames ¶ added in v1.7.0
type ConnectionParams ¶
type ConnectionPool ¶
func NewConnectionPool ¶
func NewConnectionPool(params *ConnectionParams) *ConnectionPool
func (*ConnectionPool) DisableThrottling ¶ added in v1.5.0
func (pool *ConnectionPool) DisableThrottling()
func (*ConnectionPool) PrepareStatement ¶ added in v1.5.0
func (pool *ConnectionPool) PrepareStatement(conn *pgx.Conn, stmtName string, stmt string) error
type Event ¶ added in v1.5.0
type Event struct { Vsn int64 // Voyager Sequence Number Op string TableNameTup sqlname.NameTuple Key map[string]*string Fields map[string]*string BeforeFields map[string]*string ExporterRole string }
func (*Event) GetPreparedSQLStmt ¶ added in v1.5.0
func (*Event) GetPreparedStmtName ¶ added in v1.5.0
func (*Event) IsCutoverEvent ¶ added in v1.7.0
func (*Event) IsCutoverToSource ¶ added in v1.6.2
func (*Event) IsCutoverToSourceReplica ¶ added in v1.6.2
func (*Event) IsCutoverToTarget ¶ added in v1.6.2
func (*Event) IsUniqueKeyChanged ¶ added in v1.6.5
func (*Event) UnmarshalJSON ¶ added in v1.7.0
type EventBatch ¶ added in v1.5.0
type EventBatch struct { Events []*Event ChanNo int EventCounts *EventCounter EventCountsByTable *utils.StructMap[sqlname.NameTuple, *EventCounter] }
func NewEventBatch ¶ added in v1.5.0
func NewEventBatch(events []*Event, chanNo int) *EventBatch
func (*EventBatch) GetChannelMetadataUpdateQuery ¶ added in v1.5.0
func (eb *EventBatch) GetChannelMetadataUpdateQuery(migrationUUID uuid.UUID) string
func (*EventBatch) GetLastVsn ¶ added in v1.5.0
func (eb *EventBatch) GetLastVsn() int64
func (*EventBatch) GetQueriesToInsertEventStatsByTable ¶ added in v1.5.0
func (*EventBatch) GetQueriesToUpdateEventStatsByTable ¶ added in v1.5.0
func (*EventBatch) GetTableNames ¶ added in v1.5.0
func (eb *EventBatch) GetTableNames() []sqlname.NameTuple
func (*EventBatch) ID ¶ added in v1.7.0
func (eb *EventBatch) ID() string
type EventCounter ¶ added in v1.5.0
func (*EventCounter) CountEvent ¶ added in v1.5.0
func (ec *EventCounter) CountEvent(ev *Event)
func (*EventCounter) Merge ¶ added in v1.6.0
func (ec *EventCounter) Merge(ec2 *EventCounter)
type ImportBatchArgs ¶ added in v1.5.0
type ImportBatchArgs struct { FilePath string TableNameTup sqlname.NameTuple Columns []string FileFormat string HasHeader bool Delimiter string QuoteChar byte EscapeChar byte NullString string RowsPerTransaction int64 }
func (*ImportBatchArgs) GetPGCopyStatement ¶ added in v1.6.2
func (args *ImportBatchArgs) GetPGCopyStatement() string
func (*ImportBatchArgs) GetSqlLdrControlFile ¶ added in v1.5.0
func (args *ImportBatchArgs) GetSqlLdrControlFile(tableSchema map[string]map[string]string) string
func (*ImportBatchArgs) GetYBCopyStatement ¶ added in v1.5.0
func (args *ImportBatchArgs) GetYBCopyStatement() string
type TargetConf ¶ added in v1.5.0
type TargetConf struct { TargetDBType string `json:"target_db_type"` Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` DBName string `json:"db_name"` 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"` DBSid string `json:"db_sid"` TNSAlias string `json:"tns_alias"` OracleHome string `json:"oracle_home"` Uri string `json:"uri"` ContinueOnError utils.BoolStr `json:"continue_on_error"` IgnoreIfExists utils.BoolStr `json:"ignore_if_exists"` TableList string `json:"table_list"` ExcludeTableList string `json:"exclude_table_list"` ImportMode bool `json:"import_mode"` ImportObjects string `json:"import_objects"` ExcludeImportObjects string `json:"exclude_import_objects"` DBVersion string `json:"db_version"` TargetEndpoints string `json:"target_endpoints"` UsePublicIP utils.BoolStr `json:"use_public_ip"` EnableUpsert utils.BoolStr `json:"enable_upsert"` DisableTransactionalWrites utils.BoolStr `json:"disable_transactional_writes"` Parallelism int `json:"parallelism"` }
func GetRedactedTargetConf ¶ added in v1.5.0
func GetRedactedTargetConf(t *TargetConf) *TargetConf
func (*TargetConf) Clone ¶ added in v1.5.0
func (t *TargetConf) Clone() *TargetConf
func (*TargetConf) GetConnectionUri ¶ added in v1.5.0
func (t *TargetConf) GetConnectionUri() string
type TargetDB ¶
type TargetDB interface { Init() error Finalize() InitConnPool() error PrepareForStreaming() GetVersion() string CreateVoyagerSchema() error GetNonEmptyTables(tableNames []sqlname.NameTuple) []sqlname.NameTuple IsNonRetryableCopyError(err error) bool ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, tableSchema map[string]map[string]string) (int64, error) QuoteAttributeNames(tableNameTup sqlname.NameTuple, columns []string) ([]string, error) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error GetListOfTableAttributes(tableNameTup sqlname.NameTuple) ([]string, error) QuoteAttributeName(tableNameTup sqlname.NameTuple, columnName string) (string, error) MaxBatchSizeInBytes() int64 RestoreSequences(sequencesLastValue map[string]int64) error GetIdentityColumnNamesForTable(tableNameTup sqlname.NameTuple, identityType string) ([]string, error) DisableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error EnableGeneratedAlwaysAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error EnableGeneratedByDefaultAsIdentityColumns(tableColumnsMap *utils.StructMap[sqlname.NameTuple, []string]) error ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error InvalidIndexes() (map[string]bool, error) // NOTE: The following four methods should not be used for arbitrary query // execution on TargetDB. The should be only used from higher level // abstractions like ImportDataState. Query(query string) (*sql.Rows, error) QueryRow(query string) *sql.Row Exec(query string) (int64, error) WithTx(fn func(tx *sql.Tx) error) error }
func NewTargetDB ¶ added in v1.5.0
func NewTargetDB(tconf *TargetConf) TargetDB
type TargetOracleDB ¶ added in v1.5.0
type TargetOracleDB struct { sync.Mutex *AttributeNameRegistry // contains filtered or unexported fields }
func (*TargetOracleDB) ClearMigrationState ¶ added in v1.6.0
func (tdb *TargetOracleDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
this will be only called by FallForward or FallBack DBs
func (*TargetOracleDB) CreateVoyagerSchema ¶ added in v1.5.0
func (tdb *TargetOracleDB) CreateVoyagerSchema() error
func (*TargetOracleDB) DisableGeneratedAlwaysAsIdentityColumns ¶ added in v1.5.0
func (*TargetOracleDB) EnableGeneratedAlwaysAsIdentityColumns ¶ added in v1.5.0
func (*TargetOracleDB) EnableGeneratedByDefaultAsIdentityColumns ¶ added in v1.6.0
func (*TargetOracleDB) Exec ¶ added in v1.6.0
func (tdb *TargetOracleDB) Exec(query string) (int64, error)
func (*TargetOracleDB) ExecuteBatch ¶ added in v1.5.0
func (tdb *TargetOracleDB) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
execute all events sequentially one by one in a single transaction
func (*TargetOracleDB) Finalize ¶ added in v1.5.0
func (tdb *TargetOracleDB) Finalize()
func (*TargetOracleDB) GetConnection ¶ added in v1.5.0
func (tdb *TargetOracleDB) GetConnection() *sql.Conn
func (*TargetOracleDB) GetIdentityColumnNamesForTable ¶ added in v1.6.0
func (*TargetOracleDB) GetListOfTableAttributes ¶ added in v1.7.0
func (tdb *TargetOracleDB) GetListOfTableAttributes(tableNameTup sqlname.NameTuple) ([]string, error)
func (*TargetOracleDB) GetNonEmptyTables ¶ added in v1.5.0
func (tdb *TargetOracleDB) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
func (*TargetOracleDB) GetVersion ¶ added in v1.5.0
func (tdb *TargetOracleDB) GetVersion() string
func (*TargetOracleDB) ImportBatch ¶ added in v1.5.0
func (tdb *TargetOracleDB) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, tableSchema map[string]map[string]string) (int64, error)
func (*TargetOracleDB) Init ¶ added in v1.5.0
func (tdb *TargetOracleDB) Init() error
func (*TargetOracleDB) InitConnPool ¶ added in v1.5.0
func (tdb *TargetOracleDB) InitConnPool() error
func (*TargetOracleDB) InvalidIndexes ¶ added in v1.6.5
func (tdb *TargetOracleDB) InvalidIndexes() (map[string]bool, error)
func (*TargetOracleDB) IsNonRetryableCopyError ¶ added in v1.5.0
func (tdb *TargetOracleDB) IsNonRetryableCopyError(err error) bool
func (*TargetOracleDB) MaxBatchSizeInBytes ¶ added in v1.5.0
func (tdb *TargetOracleDB) MaxBatchSizeInBytes() int64
func (*TargetOracleDB) PrepareForStreaming ¶ added in v1.5.0
func (tdb *TargetOracleDB) PrepareForStreaming()
func (*TargetOracleDB) Query ¶ added in v1.6.0
func (tdb *TargetOracleDB) Query(query string) (*sql.Rows, error)
func (*TargetOracleDB) QueryRow ¶ added in v1.6.0
func (tdb *TargetOracleDB) QueryRow(query string) *sql.Row
func (*TargetOracleDB) RestoreSequences ¶ added in v1.5.0
func (tdb *TargetOracleDB) RestoreSequences(sequencesLastVal map[string]int64) error
NOTE: TODO support for identity columns sequences
func (*TargetOracleDB) WithConnFromPool ¶ added in v1.7.0
type TargetPostgreSQL ¶ added in v1.6.2
type TargetPostgreSQL struct { sync.Mutex *AttributeNameRegistry // contains filtered or unexported fields }
func (*TargetPostgreSQL) ClearMigrationState ¶ added in v1.6.2
func (pg *TargetPostgreSQL) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
func (*TargetPostgreSQL) CreateVoyagerSchema ¶ added in v1.6.2
func (pg *TargetPostgreSQL) CreateVoyagerSchema() error
func (*TargetPostgreSQL) DisableGeneratedAlwaysAsIdentityColumns ¶ added in v1.6.2
func (*TargetPostgreSQL) EnableGeneratedAlwaysAsIdentityColumns ¶ added in v1.6.2
func (*TargetPostgreSQL) EnableGeneratedByDefaultAsIdentityColumns ¶ added in v1.6.2
func (*TargetPostgreSQL) EnsureConnected ¶ added in v1.6.2
func (pg *TargetPostgreSQL) EnsureConnected()
func (*TargetPostgreSQL) Exec ¶ added in v1.6.2
func (pg *TargetPostgreSQL) Exec(query string) (int64, error)
func (*TargetPostgreSQL) ExecuteBatch ¶ added in v1.6.2
func (pg *TargetPostgreSQL) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
TODO(future): figure out the sql error codes for prepared statements which have become invalid and needs to be prepared again
func (*TargetPostgreSQL) Finalize ¶ added in v1.6.2
func (pg *TargetPostgreSQL) Finalize()
func (*TargetPostgreSQL) GetIdentityColumnNamesForTable ¶ added in v1.6.2
func (*TargetPostgreSQL) GetListOfTableAttributes ¶ added in v1.7.0
func (pg *TargetPostgreSQL) GetListOfTableAttributes(nt sqlname.NameTuple) ([]string, error)
func (*TargetPostgreSQL) GetNonEmptyTables ¶ added in v1.6.2
func (pg *TargetPostgreSQL) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
func (*TargetPostgreSQL) GetVersion ¶ added in v1.6.2
func (pg *TargetPostgreSQL) GetVersion() string
func (*TargetPostgreSQL) ImportBatch ¶ added in v1.6.2
func (pg *TargetPostgreSQL) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, tableSchema map[string]map[string]string) (int64, error)
func (*TargetPostgreSQL) Init ¶ added in v1.6.2
func (pg *TargetPostgreSQL) Init() error
func (*TargetPostgreSQL) InitConnPool ¶ added in v1.6.2
func (pg *TargetPostgreSQL) InitConnPool() error
func (*TargetPostgreSQL) InvalidIndexes ¶ added in v1.6.5
func (pg *TargetPostgreSQL) InvalidIndexes() (map[string]bool, error)
func (*TargetPostgreSQL) IsNonRetryableCopyError ¶ added in v1.6.2
func (pg *TargetPostgreSQL) IsNonRetryableCopyError(err error) bool
func (*TargetPostgreSQL) MaxBatchSizeInBytes ¶ added in v1.6.2
func (pg *TargetPostgreSQL) MaxBatchSizeInBytes() int64
func (*TargetPostgreSQL) PrepareForStreaming ¶ added in v1.6.2
func (pg *TargetPostgreSQL) PrepareForStreaming()
func (*TargetPostgreSQL) Query ¶ added in v1.6.2
func (pg *TargetPostgreSQL) Query(query string) (*sql.Rows, error)
func (*TargetPostgreSQL) QueryRow ¶ added in v1.6.2
func (pg *TargetPostgreSQL) QueryRow(query string) *sql.Row
func (*TargetPostgreSQL) RestoreSequences ¶ added in v1.6.2
func (pg *TargetPostgreSQL) RestoreSequences(sequencesLastVal map[string]int64) error
type TargetYugabyteDB ¶ added in v1.5.0
type TargetYugabyteDB struct { sync.Mutex *AttributeNameRegistry // contains filtered or unexported fields }
func (*TargetYugabyteDB) ClearMigrationState ¶ added in v1.6.0
func (yb *TargetYugabyteDB) ClearMigrationState(migrationUUID uuid.UUID, exportDir string) error
func (*TargetYugabyteDB) CreateVoyagerSchema ¶ added in v1.5.0
func (yb *TargetYugabyteDB) CreateVoyagerSchema() error
func (*TargetYugabyteDB) DisableGeneratedAlwaysAsIdentityColumns ¶ added in v1.5.0
func (*TargetYugabyteDB) EnableGeneratedAlwaysAsIdentityColumns ¶ added in v1.5.0
func (*TargetYugabyteDB) EnableGeneratedByDefaultAsIdentityColumns ¶ added in v1.6.0
func (*TargetYugabyteDB) EnsureConnected ¶ added in v1.5.0
func (yb *TargetYugabyteDB) EnsureConnected()
func (*TargetYugabyteDB) Exec ¶ added in v1.6.0
func (yb *TargetYugabyteDB) Exec(query string) (int64, error)
func (*TargetYugabyteDB) ExecuteBatch ¶ added in v1.5.0
func (yb *TargetYugabyteDB) ExecuteBatch(migrationUUID uuid.UUID, batch *EventBatch) error
TODO(future): figure out the sql error codes for prepared statements which have become invalid and needs to be prepared again
func (*TargetYugabyteDB) Finalize ¶ added in v1.5.0
func (yb *TargetYugabyteDB) Finalize()
func (*TargetYugabyteDB) GetAllSchemaNamesRaw ¶ added in v1.7.0
func (yb *TargetYugabyteDB) GetAllSchemaNamesRaw() ([]string, error)
func (*TargetYugabyteDB) GetAllSequencesRaw ¶ added in v1.7.0
func (yb *TargetYugabyteDB) GetAllSequencesRaw(schemaName string) ([]string, error)
GetAllSequencesRaw returns all the sequence names in the database for the schema
func (*TargetYugabyteDB) GetAllTableNamesRaw ¶ added in v1.7.0
func (yb *TargetYugabyteDB) GetAllTableNamesRaw(schemaName string) ([]string, error)
func (*TargetYugabyteDB) GetIdentityColumnNamesForTable ¶ added in v1.6.0
func (*TargetYugabyteDB) GetListOfTableAttributes ¶ added in v1.7.0
func (yb *TargetYugabyteDB) GetListOfTableAttributes(nt sqlname.NameTuple) ([]string, error)
func (*TargetYugabyteDB) GetNonEmptyTables ¶ added in v1.5.0
func (yb *TargetYugabyteDB) GetNonEmptyTables(tables []sqlname.NameTuple) []sqlname.NameTuple
func (*TargetYugabyteDB) GetVersion ¶ added in v1.5.0
func (yb *TargetYugabyteDB) GetVersion() string
func (*TargetYugabyteDB) ImportBatch ¶ added in v1.5.0
func (yb *TargetYugabyteDB) ImportBatch(batch Batch, args *ImportBatchArgs, exportDir string, tableSchema map[string]map[string]string) (int64, error)
func (*TargetYugabyteDB) Init ¶ added in v1.5.0
func (yb *TargetYugabyteDB) Init() error
func (*TargetYugabyteDB) InitConnPool ¶ added in v1.5.0
func (yb *TargetYugabyteDB) InitConnPool() error
func (*TargetYugabyteDB) InvalidIndexes ¶ added in v1.6.5
func (yb *TargetYugabyteDB) InvalidIndexes() (map[string]bool, error)
func (*TargetYugabyteDB) IsNonRetryableCopyError ¶ added in v1.5.0
func (yb *TargetYugabyteDB) IsNonRetryableCopyError(err error) bool
func (*TargetYugabyteDB) MaxBatchSizeInBytes ¶ added in v1.5.0
func (yb *TargetYugabyteDB) MaxBatchSizeInBytes() int64
func (*TargetYugabyteDB) PrepareForStreaming ¶ added in v1.5.0
func (yb *TargetYugabyteDB) PrepareForStreaming()
func (*TargetYugabyteDB) Query ¶ added in v1.6.0
func (yb *TargetYugabyteDB) Query(query string) (*sql.Rows, error)
func (*TargetYugabyteDB) QueryRow ¶ added in v1.6.0
func (yb *TargetYugabyteDB) QueryRow(query string) *sql.Row
func (*TargetYugabyteDB) RestoreSequences ¶ added in v1.5.0
func (yb *TargetYugabyteDB) RestoreSequences(sequencesLastVal map[string]int64) error