Add dialects

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
m.nabokikh
2021-09-13 17:48:02 +04:00
parent eae3219e4d
commit fb38e1235d
64 changed files with 1198 additions and 596 deletions

View File

@@ -0,0 +1,21 @@
package schema
import (
"entgo.io/ent/dialect"
)
var textSchema = map[string]string{
dialect.Postgres: "text",
dialect.SQLite: "text",
// MySQL doesn't support indices on text fields w/o
// specifying key length. Use varchar instead (767 byte
// is the max key length for InnoDB with 4k pages).
// For compound indexes (with two keys) even less.
dialect.MySQL: "varchar(384)",
}
var timeSchema = map[string]string{
dialect.Postgres: "timestamptz",
dialect.SQLite: "timestamp",
dialect.MySQL: "datetime(3)",
}