MCPcopy
hub / github.com/xo/dbtpl / Scan

Method Scan

_examples/django/sqlite3/dbtpl.dbtpl.go:185–196  ·  view source on GitHub ↗

Scan satisfies the sql.Scanner interface.

(v any)

Source from the content-addressed store, hash-verified

183
184// Scan satisfies the sql.Scanner interface.
185func (t *Time) Scan(v any) error {
186 switch x := v.(type) {
187 case time.Time:
188 t.time = x
189 return nil
190 case []byte:
191 return t.Parse(string(x))
192 case string:
193 return t.Parse(x)
194 }
195 return ErrInvalidTime(fmt.Sprintf("%T", v))
196}
197
198// Parse attempts to Parse string s to t.
199func (t *Time) Parse(s string) error {

Callers 15

InsertMethod · 0.45
BookByBookIDFunction · 0.45
BooksByBooksAuthorIDFkeyFunction · 0.45
InsertMethod · 0.45
InsertMethod · 0.45
AuthGroupByIDFunction · 0.45
AuthGroupByNameFunction · 0.45

Calls 2

ParseMethod · 0.95
ErrInvalidTimeTypeAlias · 0.70

Tested by

no test coverage detected