typrails

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityName

func EntityName(tableName string) string

EntityName return entity name

func Module

func Module() interface{}

Module of typrails

Types

type Entity

type Entity struct {
	Name           string
	Type           string
	Table          string
	Cache          string
	ProjectPackage string
	Fields         []Field
	Forms          []Field
}

Entity of database

type Fetcher

type Fetcher struct {
	dig.In
	*sql.DB
}

Fetcher responsible to fetch entity

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(pkg, tableName string) (e *Entity, err error)

Fetch entity from database based on table name

type Field

type Field struct {
	Name      string
	Type      string
	Udt       string
	Column    string
	StructTag string
}

Field of entity

func CreateField

func CreateField(column, udt string) Field

CreateField to create field

type InfoSchema

type InfoSchema struct {
	ColumnName string
	DataType   string
}

InfoSchema is infomation schema from database

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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