atlas

package
v0.0.0-...-6131656 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbTypeStr map[DbType]string = map[DbType]string{
	DbTypeEmpty:       "empty",
	DbTypeMySQL:       "mysql",
	DbTypeMaria:       "mariadb",
	DbTypePostgre:     "postgres",
	DbTypeSQLite:      "sqlite",
	DbTypeTiDB:        "tidb",
	DbTypeCockroachDB: "cockroachdb",
}
View Source
var DbTypeStrReverse map[string]DbType = map[string]DbType{
	"empty":       DbTypeEmpty,
	"mysql":       DbTypeMySQL,
	"mariadb":     DbTypeMaria,
	"postgres":    DbTypePostgre,
	"sqlite":      DbTypeSQLite,
	"tidb":        DbTypeTiDB,
	"cockroachdb": DbTypeCockroachDB,
}

Functions

This section is empty.

Types

type Atlas

type Atlas struct {
	DbName string
	DbType DbType
	// contains filtered or unexported fields
}

func New

func New(dbType DbType, conn *db.Conn) *Atlas

func (*Atlas) Init

func (t *Atlas) Init(dbType DbType, conn *db.Conn) error

func (*Atlas) InspectSchema

func (t *Atlas) InspectSchema() (*schema.Schema, error)

func (*Atlas) Load

func (t *Atlas) Load(path string) (*schema.Schema, error)

func (*Atlas) MarshalHCL

func (t *Atlas) MarshalHCL(sch *schema.Schema) ([]byte, error)

func (*Atlas) MigrateSchema

func (t *Atlas) MigrateSchema(sch *schema.Schema) error

func (*Atlas) Save

func (t *Atlas) Save(path string, sch *schema.Schema) error

func (*Atlas) UnmarshalHCL

func (t *Atlas) UnmarshalHCL(bt []byte) (*schema.Schema, error)

type DbType

type DbType int8
const (
	DbTypeEmpty DbType = iota
	DbTypeMySQL
	DbTypeMaria
	DbTypePostgre
	DbTypeSQLite
	DbTypeTiDB
	DbTypeCockroachDB
)

Jump to

Keyboard shortcuts

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