schematype

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 3 Imported by: 0

README

schematype

schema type helper for ent fields

install

go get -u github.com/246859/schematype

example

func (User) Fields() []ent.Field {
    return []ent.Field{
		// mysql varchar
        field.String("name").SchemaType(schematype.MySQL().VarChar(255)),
        field.Int("age").SchemaType(schematype.MySQL().TinyInt(0)),
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GremlinSchemaType

type GremlinSchemaType map[string]string

func (GremlinSchemaType) MYSQL

func (GremlinSchemaType) Postgres

func (GremlinSchemaType) SQLite

func (GremlinSchemaType) Type

func (g GremlinSchemaType) Type(typ string)

type MysqlSchemaType

type MysqlSchemaType map[string]string

MysqlSchemaType is a mysql schema type builder, see https://dev.mysql.com/doc/refman/8.0/en/data-types.html for more information.

func MySQL

func MySQL() MysqlSchemaType

MySQL returns mysql schema type builder

func (MysqlSchemaType) BigInt

func (s MysqlSchemaType) BigInt(m int) MysqlSchemaType

func (MysqlSchemaType) Binary

func (s MysqlSchemaType) Binary(m int) MysqlSchemaType

func (MysqlSchemaType) Bit

func (MysqlSchemaType) Blob

func (MysqlSchemaType) Bool

func (MysqlSchemaType) Char

func (MysqlSchemaType) CharSet

func (s MysqlSchemaType) CharSet(charset string) MysqlSchemaType

func (MysqlSchemaType) Collate

func (s MysqlSchemaType) Collate(collate string) MysqlSchemaType

func (MysqlSchemaType) Date

func (s MysqlSchemaType) Date(m int, d int) MysqlSchemaType

func (MysqlSchemaType) DateTime

func (s MysqlSchemaType) DateTime(fsp int) MysqlSchemaType

func (MysqlSchemaType) Decimal

func (s MysqlSchemaType) Decimal(m int, d int) MysqlSchemaType

func (MysqlSchemaType) Double

func (s MysqlSchemaType) Double(m int, d int) MysqlSchemaType

func (MysqlSchemaType) Enum

func (s MysqlSchemaType) Enum(values ...string) MysqlSchemaType

func (MysqlSchemaType) Float

func (s MysqlSchemaType) Float(m int, d int) MysqlSchemaType

func (MysqlSchemaType) Geometry

func (s MysqlSchemaType) Geometry() MysqlSchemaType

func (MysqlSchemaType) Gremlin

func (s MysqlSchemaType) Gremlin() GremlinSchemaType

func (MysqlSchemaType) Int

func (MysqlSchemaType) Integer

func (s MysqlSchemaType) Integer(m int) MysqlSchemaType

func (MysqlSchemaType) JSON

func (MysqlSchemaType) LongBlob

func (s MysqlSchemaType) LongBlob(m int) MysqlSchemaType

func (MysqlSchemaType) LongText

func (s MysqlSchemaType) LongText(m int) MysqlSchemaType

func (MysqlSchemaType) MediumBlob

func (s MysqlSchemaType) MediumBlob(m int) MysqlSchemaType

func (MysqlSchemaType) MediumInt

func (s MysqlSchemaType) MediumInt(m int) MysqlSchemaType

func (MysqlSchemaType) MediumText

func (s MysqlSchemaType) MediumText(m int) MysqlSchemaType

func (MysqlSchemaType) Numeric

func (s MysqlSchemaType) Numeric(m int, d int) MysqlSchemaType

func (MysqlSchemaType) Point

func (s MysqlSchemaType) Point() MysqlSchemaType

func (MysqlSchemaType) Postgres

func (s MysqlSchemaType) Postgres() PostgresSchemaType

func (MysqlSchemaType) SQLite

func (s MysqlSchemaType) SQLite() SQLiteSchemaType

func (MysqlSchemaType) Set

func (s MysqlSchemaType) Set(values ...string) MysqlSchemaType

func (MysqlSchemaType) SmallInt

func (s MysqlSchemaType) SmallInt(m int) MysqlSchemaType

func (MysqlSchemaType) Text

func (MysqlSchemaType) Time

func (s MysqlSchemaType) Time(fsp int) MysqlSchemaType

func (MysqlSchemaType) Timestamp

func (s MysqlSchemaType) Timestamp(fsp int) MysqlSchemaType

func (MysqlSchemaType) TinyBlob

func (s MysqlSchemaType) TinyBlob(m int) MysqlSchemaType

func (MysqlSchemaType) TinyInt

func (s MysqlSchemaType) TinyInt(m int) MysqlSchemaType

func (MysqlSchemaType) TinyText

func (s MysqlSchemaType) TinyText(m int) MysqlSchemaType

func (MysqlSchemaType) Type

func (s MysqlSchemaType) Type(v string)

func (MysqlSchemaType) UnSigned

func (s MysqlSchemaType) UnSigned() MysqlSchemaType

func (MysqlSchemaType) VarBinary

func (s MysqlSchemaType) VarBinary(m int) MysqlSchemaType

func (MysqlSchemaType) VarChar

func (s MysqlSchemaType) VarChar(m int) MysqlSchemaType

func (MysqlSchemaType) Year

func (MysqlSchemaType) ZeroFill

func (s MysqlSchemaType) ZeroFill() MysqlSchemaType

type PostgresSchemaType

type PostgresSchemaType map[string]string

func (PostgresSchemaType) Gremlin

func (PostgresSchemaType) MYSQL

func (PostgresSchemaType) SQLite

func (PostgresSchemaType) Type

func (p PostgresSchemaType) Type(v string)

type SQLiteSchemaType

type SQLiteSchemaType map[string]string

func (SQLiteSchemaType) Gremlin

func (s SQLiteSchemaType) Gremlin() GremlinSchemaType

func (SQLiteSchemaType) MYSQL

func (SQLiteSchemaType) Postgres

func (s SQLiteSchemaType) Postgres() PostgresSchemaType

func (SQLiteSchemaType) Type

func (s SQLiteSchemaType) Type(v string)

Jump to

Keyboard shortcuts

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