dialect/sql/schema: add postgres table and column builders

Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/114

Reviewed By: alexsn

Differential Revision: D18059082

fbshipit-source-id: fffec25143fa5f2a0ed2c79787abacefad724862
This commit is contained in:
Ariel Mashraki
2019-10-22 08:15:21 -07:00
committed by Facebook Github Bot
parent 67c1d5262a
commit 8be31d18f9
2 changed files with 37 additions and 0 deletions

View File

@@ -1892,6 +1892,17 @@ func (d *dialectBuilder) AlterTable(name string) *TableAlter {
return b
}
// Column creates a ColumnBuilder for the configured dialect.
//
// Dialect(dialect.Postgres)..
// Column("group_id").Type("int").Attr("UNIQUE")
//
func (d *dialectBuilder) Column(name string) *ColumnBuilder {
b := Column(name)
b.SetDialect(d.dialect)
return b
}
// Insert creates a InsertBuilder for the configured dialect.
//
// Dialect(dialect.Postgres).