sqldump

package
v0.0.0-...-b14404a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpMySQL

func DumpMySQL(sql *SQL) ([]byte, error)

func DumpPostgres

func DumpPostgres(sql *SQL) ([]byte, error)

func MatchMySQLQuery

func MatchMySQLQuery(a, b string) (bool, error)

MatchMySQLQuery checks if two queries are equal, ignoring variables.

func MatchPostgresQuery

func MatchPostgresQuery(a, b string) (bool, error)

MatchPostgresQuery checks if two queries are equal, ignoring variables.

Types

type SQL

type SQL struct {
	Query      string
	Normalized string
	Args       []any
	// Key-value representation of the ArgMap.
	// Since it can be yaml or json, we leave it to unmarshal to decide.
	ArgMap any
	VarMap any
	Result any
}

func Read

func Read(b []byte) (*SQL, error)

type Var

type Var struct {
	Name  string
	Value string
}

func MySQLVars

func MySQLVars(q string) ([]Var, error)

func PostgresVars

func PostgresVars(q string) ([]Var, error)

Jump to

Keyboard shortcuts

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