global

package
v0.0.0-...-3f58490 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableRegexp             = `CREATE TABLE(?: IF NOT EXISTS)? (?P<tableName>\w+.\w+) \((?P<tableFields>.+)\)`
	FieldRegexp             = `^\s*(\w+)\s+([a-zA-Z0-9_ ]*)(?:\((\d+)\))?`
	InTablePkRegexp         = `PRIMARY\s+KEY\s+\((.*?)\)`
	StandaloneFkRegexp      = `` /* 144-byte string literal not displayed */
	StandalonePkRegex       = `ALTER\s+TABLE\s+(?:ONLY\s+)?(\w+.?\w+)\s+ADD\s+CONSTRAINT\s+\w+\s+PRIMARY\s+KEY\s+\(([\w\s,]+)\)`
	ConstraintRemovalRegexp = `^\s*CREATE INDEX.*`
	IndexRemovalRegexp      = `^\s*CONSTRAINT.*`
)

Variables

This section is empty.

Functions

func CleanUpLine

func CleanUpLine(s []string) []string

func CleanUpString

func CleanUpString(s string) string

func Contains

func Contains(s []string, e string) bool

func GetDryRun

func GetDryRun() bool

func GetLogger

func GetLogger() *slog.Logger

func GetVerbose

func GetVerbose() bool

func PrintStruct

func PrintStruct(object interface{})

func RemoveComments

func RemoveComments(s []string) []string

func RemoveConstraints

func RemoveConstraints(s []string) []string

func SetDryRun

func SetDryRun(d bool)

func SetLogger

func SetLogger(level slog.Level)

func SetVerbose

func SetVerbose(v bool)

func SplitAndGetFields

func SplitAndGetFields(raw string) []string

func Unquote

func Unquote(raw string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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