Documentation ¶
Overview ¶
Copyright 2023 Google LLC
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
- func CreateDatabaseClient(ctx context.Context, targetProfile profiles.TargetProfile, ...) (*database.DatabaseAdminClient, *sp.Client, string, error)
- func MigrateDatabase(ctx context.Context, migrationProjectId string, ...) (*writer.BatchWriter, error)
- func PrepareMigrationPrerequisites(sourceProfileString, targetProfileString, source string) (profiles.SourceProfile, profiles.TargetProfile, utils.IOStreams, string, error)
- func ValidateResourceGenerationHelper(ctx context.Context, migrationProjectId string, instanceId string, ...) error
- type CleanupCmd
- type DataCmd
- type SchemaAndDataCmd
- func (cmd *SchemaAndDataCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus
- func (cmd *SchemaAndDataCmd) Name() string
- func (cmd *SchemaAndDataCmd) SetFlags(f *flag.FlagSet)
- func (cmd *SchemaAndDataCmd) Synopsis() string
- func (cmd *SchemaAndDataCmd) Usage() string
- type SchemaCmd
Constants ¶
const (
DefaultWritersLimit = 40
)
Variables ¶
This section is empty.
Functions ¶
func CreateDatabaseClient ¶
func CreateDatabaseClient(ctx context.Context, targetProfile profiles.TargetProfile, driver, dbName string, ioHelper utils.IOStreams) (*database.DatabaseAdminClient, *sp.Client, string, error)
CreateDatabaseClient creates new database client and admin client.
func MigrateDatabase ¶
func MigrateDatabase(ctx context.Context, migrationProjectId string, targetProfile profiles.TargetProfile, sourceProfile profiles.SourceProfile, dbName string, ioHelper *utils.IOStreams, cmd interface{}, conv *internal.Conv, migrationError *error) (*writer.BatchWriter, error)
MigrateData creates database and populates data in it.
func PrepareMigrationPrerequisites ¶
func PrepareMigrationPrerequisites(sourceProfileString, targetProfileString, source string) (profiles.SourceProfile, profiles.TargetProfile, utils.IOStreams, string, error)
PrepareMigrationPrerequisites creates source and target profiles, opens a new IOStream and generates the database name.
Types ¶
type CleanupCmd ¶
type CleanupCmd struct {
// contains filtered or unexported fields
}
CleanupCmd is the command for cleaning up the migration resources during a minimal downtime migration.
func (*CleanupCmd) Execute ¶
func (cmd *CleanupCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus
func (*CleanupCmd) SetFlags ¶
func (cmd *CleanupCmd) SetFlags(f *flag.FlagSet)
SetFlags sets the flags.
func (*CleanupCmd) Synopsis ¶
func (cmd *CleanupCmd) Synopsis() string
Synopsis returns summary of operation.
func (*CleanupCmd) Usage ¶
func (cmd *CleanupCmd) Usage() string
Usage returns usage info of the command.
type DataCmd ¶
type DataCmd struct { WriteLimit int64 SkipForeignKeys bool // contains filtered or unexported fields }
DataCmd struct with flags.
func (*DataCmd) Execute ¶
func (cmd *DataCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus
type SchemaAndDataCmd ¶
type SchemaAndDataCmd struct { SkipForeignKeys bool WriteLimit int64 // contains filtered or unexported fields }
SchemaAndDataCmd struct with flags.
func (*SchemaAndDataCmd) Execute ¶
func (cmd *SchemaAndDataCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus
func (*SchemaAndDataCmd) Name ¶
func (cmd *SchemaAndDataCmd) Name() string
Name returns the name of operation.
func (*SchemaAndDataCmd) SetFlags ¶
func (cmd *SchemaAndDataCmd) SetFlags(f *flag.FlagSet)
SetFlags sets the flags.
func (*SchemaAndDataCmd) Synopsis ¶
func (cmd *SchemaAndDataCmd) Synopsis() string
Synopsis returns summary of operation.
func (*SchemaAndDataCmd) Usage ¶
func (cmd *SchemaAndDataCmd) Usage() string
Usage returns usage info of the command.
type SchemaCmd ¶
type SchemaCmd struct {
// contains filtered or unexported fields
}
SchemaCmd struct with flags.
func (*SchemaCmd) Execute ¶
func (cmd *SchemaCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus