driver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FuncTag = "func:"
)
View Source
const (
	Nullable = "Nullable"
)

Variables

This section is empty.

Functions

func OpenCK

func OpenCK(db schema.ExecQuerier) (*ckDriver, error)

func ParseType

func ParseType(raw string) (schema.Type, error)

ParseType returns the schema.Type value represented by the given raw type. The raw value is expected to follow the format in MySQL information schema.

func TableName

func TableName(typeName string) string

func TypeName

func TypeName(tableName string) string

Types

type AtlasBase

type AtlasBase struct {
	schema.Inspector

	Options ImportOptions
	Types   map[string]*gen.Type
	// contains filtered or unexported fields
}

AtlasBase is the base struct witch can be used by Atlas

func (*AtlasBase) BuildSchema

func (ab *AtlasBase) BuildSchema(tables []*schema.Table) ([]*gen.Type, error)

func (*AtlasBase) SchemaInspect

func (ab *AtlasBase) SchemaInspect(ctx context.Context) ([]*gen.Type, error)

func (*AtlasBase) TableToGenType

func (ab *AtlasBase) TableToGenType(table *schema.Table) (*gen.Type, error)

type Clickhouse

type Clickhouse struct {
	AtlasBase
	// contains filtered or unexported fields
}

func NewClickhouse

func NewClickhouse(opts ImportOptions) (*Clickhouse, error)

NewClickhouse creates a new Clickhouse driver.

type GqlOrderField

type GqlOrderField struct {
	// contains filtered or unexported fields
}

func (GqlOrderField) Name

func (g GqlOrderField) Name() string

type ImportOptions

type ImportOptions struct {
	Dialect       string
	DSN           string
	Tables        []string
	SchemaPath    string
	CaseInt       bool //default is true, int8,32,64 --> Int
	GenProtoField bool //default is false, generate proto field order
	GenGraphql    bool //default is false, generate graphql
}

ImportOptions holds the options for the import command.

type MySQL

type MySQL struct {
	AtlasBase
	// contains filtered or unexported fields
}

MySQL holds the schema import options and an Atlas inspector instance

func NewMySQL

func NewMySQL(opts ImportOptions) (*MySQL, error)

NewMySQL - create an import structure for MySQL.

Jump to

Keyboard shortcuts

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