Open calls ent.Open and auto-run migration.
(t TestingT, driverName, dataSourceName string, opts ...Option)
| 54 | |
| 55 | // Open calls ent.Open and auto-run migration. |
| 56 | func Open(t TestingT, driverName, dataSourceName string, opts ...Option) *ent.Client { |
| 57 | o := newOptions(opts) |
| 58 | c, err := ent.Open(driverName, dataSourceName, o.opts...) |
| 59 | if err != nil { |
| 60 | t.Error(err) |
| 61 | t.FailNow() |
| 62 | } |
| 63 | migrateSchema(t, c, o) |
| 64 | return c |
| 65 | } |
| 66 | |
| 67 | // NewClient calls ent.NewClient and auto-run migration. |
| 68 | func NewClient(t TestingT, opts ...Option) *ent.Client { |
nothing calls this directly
no test coverage detected