project

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: PostgreSQL Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR       = "error"
	NEW         = "new"
	INITIALIZED = "initialized"
	INSPECTED   = "inspected"
	AUDITED     = "audited"
	CONVERTED   = "converted"
)

Variables

This section is empty.

Functions

func Abs added in v0.0.13

func Abs(p string) string

Abs returns the absolute path of a JSON file.

Resolve path for current project. Add missing json extension if needed. Resolve to internal json file for known file names.

func Offline added in v0.18.0

func Offline()

Offline disable source access

func Open added in v0.18.0

func Open() error

func Rel added in v0.0.13

func Rel(p string) string

func WriteJson added in v0.29.0

func WriteJson(name string, data any) error

WriteJson saves data as project JSON file.

Use [Json] to read file.

Types

type Config added in v0.0.2

type Config struct {
	Reports []string `comment:"Markdown and JSON reports to build."`
	Schemas []string `comment:"Restrict to schemas matching one of these patterns."`
	Scores  Scores
	Convert Convert
	Dump    Dump
}

type Convert added in v0.22.0

type Convert struct {
	PreserveCase bool
	Rules        []convertRule

	DataTypes map[string]string
	// contains filtered or unexported fields
}

func (Convert) Rule added in v0.22.0

func (c Convert) Rule(path string) convertRule

type Dump added in v0.27.0

type Dump struct {
	Exclude    []string
	StripZeros bool
}

Dump holds dump configuration.

type DumpParams added in v0.26.0

type DumpParams struct {
	Clean    bool
	PreData  bool
	Data     bool
	PostData bool
}

DumpParams describes an expected dump.

type Info

type Info struct {
	Creator string
	Created time.Time
	Driver  string
	Source  ServerInfo
	Target  ServerInfo
}

type Project

type Project struct {
	Path       string
	Status     string
	Config     Config
	DumpParams DumpParams
	Info       Info       `json:"-"`
	Source     *dburl.URL `json:"-"`
	Target     *dburl.URL `json:"-"`
}
var Current Project

func (Project) Dir

func (p Project) Dir() string

func (*Project) GuessStatus added in v0.0.10

func (p *Project) GuessStatus() string

func (Project) Json added in v0.0.2

func (p Project) Json(name string, out any) error

Json reads named project JSON file

Use WriteJson to save to JSON file.

func (*Project) Load added in v0.26.0

func (p *Project) Load(f io.Reader) error

func (Project) Name added in v0.0.14

func (p Project) Name() string

func (Project) Online added in v0.0.14

func (p Project) Online() bool

func (*Project) Read

func (p *Project) Read() error

func (Project) Toml added in v0.0.2

func (p Project) Toml() string

type Scores added in v0.0.7

type Scores struct {
	DatabaseLink                   float32
	DatabaseLinkPublic             float32
	Column                         float32
	ColumnTypeEnum                 float32
	ColumnTypeSet                  float32
	ColumnTypeLarge                float32
	ColumnMissingPrecision         float32
	ColumnNegativeScale            float32
	ColumnOnUpdateCurrentTimestamp float32
	Constraint                     float32
	FkeyPrecisionMismatch          float32
	Index                          float32
	IndexInvisible                 float32
	IndexIrregular                 float32
	InspectionError                float32
	IdentifierMixedCase            float32
	IdentifierTooLong              float32
	IdentifierReservedKeyword      float32
	IdentityDecimal                float32
	JavaSource                     float32
	Job                            float32
	Key                            float32
	MaterializedView               float32
	MaterializedViewFast           float32
	MaterializedViewScheduled      float32
	PackageInit                    float32
	PackagePrivate                 float32
	Partition                      float32
	PartitionTypeUnhandled         float32
	PartitionKeyComposite          float32
	Routine                        float32
	RoutineLine                    float32
	RoutineSourceMissing           float32
	Schema                         float32
	SchemaWithoutPrivileges        float32
	Sequence                       float32
	Synonym                        float32
	SynonymDBLink                  float32
	Table                          float32
	TableCSV                       float32
	TableFederated                 float32
	TemporaryTable                 float32
	TransqlateError                float32
	Type                           float32
	TypeSuperType                  float32
	View                           float32
	ViewReadOnly                   float32
	VirtualColumn                  float32
}

type ServerInfo added in v0.24.0

type ServerInfo struct {
	InitialDSN string
	Software   string
	Version    string
}

Jump to

Keyboard shortcuts

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