cmd

package
v1.0.1-0...-b7ad348 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

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

View Source
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.

func ValidateResourceGenerationHelper

func ValidateResourceGenerationHelper(ctx context.Context, migrationProjectId string, instanceId string, sourceProfile profiles.SourceProfile, conv *internal.Conv) error

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

func (cmd *CleanupCmd) Name() string

Name returns the name of operation.

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

func (*DataCmd) Name

func (cmd *DataCmd) Name() string

Name returns the name of operation.

func (*DataCmd) SetFlags

func (cmd *DataCmd) SetFlags(f *flag.FlagSet)

SetFlags sets the flags.

func (*DataCmd) Synopsis

func (cmd *DataCmd) Synopsis() string

Synopsis returns summary of operation.

func (*DataCmd) Usage

func (cmd *DataCmd) Usage() string

Usage returns usage info of the command.

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

func (*SchemaCmd) Name

func (cmd *SchemaCmd) Name() string

Name returns the name of operation.

func (*SchemaCmd) SetFlags

func (cmd *SchemaCmd) SetFlags(f *flag.FlagSet)

SetFlags sets the flags.

func (*SchemaCmd) Synopsis

func (cmd *SchemaCmd) Synopsis() string

Synopsis returns summary of operation.

func (*SchemaCmd) Usage

func (cmd *SchemaCmd) Usage() string

Usage returns usage info of the command.

Jump to

Keyboard shortcuts

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