MCPcopy Index your code
hub / github.com/micro/go-micro / schema

Method schema

model/postgres/postgres.go:82–91  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

80}
81
82func (d *postgresModel) schema(v interface{}) (*model.Schema, error) {
83 t := model.ResolveType(v)
84 d.mu.RLock()
85 s, ok := d.types[t]
86 d.mu.RUnlock()
87 if !ok {
88 return nil, model.ErrNotRegistered
89 }
90 return s, nil
91}
92
93func (d *postgresModel) Create(ctx context.Context, v interface{}) error {
94 schema, err := d.schema(v)

Callers 5

CreateMethod · 0.95
ReadMethod · 0.95
UpdateMethod · 0.95
DeleteMethod · 0.95
CountMethod · 0.95

Calls 1

ResolveTypeFunction · 0.92

Tested by

no test coverage detected