dialect/entsql: add helper function for creating table annotation (#3816)

This commit is contained in:
Ariel Mashraki
2023-11-10 10:44:14 +02:00
committed by GitHub
parent 5718c3001b
commit 37f57d9a97

View File

@@ -146,6 +146,20 @@ func (Annotation) Name() string {
return "EntSQL"
}
// The Table option allows overriding the default table
// name that is generated by ent. For example:
//
// func (T) Annotations() []schema.Annotation {
// return []schema.Annotation{
// entsql.Table("Users"),
// }
// }
func Table(t string) *Annotation {
return &Annotation{
Table: t,
}
}
// Check allows injecting custom "DDL" for setting an unnamed "CHECK" clause in "CREATE TABLE".
//
// entsql.Annotation{