cmd

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Copyright © 2024 Thearas [email protected]

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 © 2024 Thearas [email protected]

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 © 2024 Thearas [email protected]

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 © 2025 Thearas [email protected]

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 © 2024 Thearas [email protected]

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 © 2024 Thearas [email protected]

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 © 2025 Thearas [email protected]

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 © 2025 Thearas [email protected]

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 © 2025 Thearas [email protected]

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 © 2024 Thearas [email protected]

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 © 2024 Thearas [email protected]

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

This section is empty.

Variables

View Source
var (
	GlobalConfig    = Global{}
	DefaultParallel = 10
)
View Source
var AnonymizeConfig = Anonymize{}
View Source
var DumpConfig = Dump{}
View Source
var GendataConfig = Gendata{}

GendataConfig holds the configuration values

View Source
var ImportConfig = Import{}

ImportConfig holds the configuration values

View Source
var ReplayConfig = Replay{}

Functions

func AnonymizeSQL added in v1.1.3

func AnonymizeSQL(identifier, sql string) string

func AnonymizeStats added in v1.1.3

func AnonymizeStats(s []*src.TableStats) []*src.TableStats

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewQueryWriter

func NewQueryWriter(filecount, fileidx int) src.SqlWriter

func SetupAnonymizer added in v1.1.3

func SetupAnonymizer()

Types

type Anonymize

type Anonymize struct {
	// common
	Enabled      bool
	Method       string
	IdMinLength  int
	ReserveIds   []string
	HashDictPath string

	// only for anonymize cmd
	File string
}

type Dump

type Dump struct {
	AuditLogPaths []string
	AuditLogTable string

	OutputDDLDir          string
	OutputQueryDir        string
	LocalAuditLogCacheDir string
	AuditLogEncoding      string

	SSHAddress    string
	SSHPassword   string
	SSHPrivateKey string

	DumpSchema         bool
	DumpStats          bool
	DumpQuery          bool
	QueryMinDuration_  time.Duration
	QueryMinDurationMs int64
	QueryStates        []string
	OnlySelect         bool
	Strict             bool
	From, To           string
	Analyze            bool

	Clean bool
}

type Gendata

type Gendata struct {
	DDL           string
	OutputDataDir string
	GenConf       string
	NumRows       int
	RowsPerFile   int
	LLM           string
	LLMApiKey     string
	Query         string
	Prompt        string
	// contains filtered or unexported fields
}

Gendata holds the configuration for the gendata command

type Global

type Global struct {
	ConfigFile  string
	LogLevel    string
	DodoDataDir string
	OutputDir   string
	DryRun      bool
	Parallel    int

	DBHost     string
	DBPort     uint16
	HTTPPort   uint16
	DBUser     string
	DBPassword string
	Catalog    string
	DBs        []string
	Tables     []string
}

type Import

type Import struct {
	Data string
	// contains filtered or unexported fields
}

Import holds the configuration for the gendata command

type Replay

type Replay struct {
	Cluster         string
	ReplayFile      string
	ReplayResultDir string
	Users_          []string
	From_, To_      string
	ClientCount     int
	Speed           float32
	MaxHashRows     int
	MaxConnIdleTime time.Duration

	DBs      map[string]struct{}
	Users    map[string]struct{}
	From, To int64

	Clean bool
}

Jump to

Keyboard shortcuts

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