MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseDDate

Function ParseDDate

pkg/sql/sem/tree/datum.go:2135–2139  ·  view source on GitHub ↗

ParseDDate parses and returns the *DDate Datum value represented by the provided string in the provided location, or an error if parsing is unsuccessful. The dependsOnContext return value indicates if we had to consult the ParseContext (either for the time or the local timezone).

(ctx ParseContext, s string)

Source from the content-addressed store, hash-verified

2133// The dependsOnContext return value indicates if we had to consult the
2134// ParseContext (either for the time or the local timezone).
2135func ParseDDate(ctx ParseContext, s string) (_ *DDate, dependsOnContext bool, _ error) {
2136 now := relativeParseTime(ctx)
2137 t, dependsOnContext, err := pgdate.ParseDate(now, dateStyle(ctx), s, dateParseHelper(ctx))
2138 return NewDDate(t), dependsOnContext, err
2139}
2140
2141// AsDDate attempts to retrieve a DDate from an Expr, returning a DDate and
2142// a flag signifying whether the assertion was successful. The function should

Callers 2

FuzzParseDDateFunction · 0.85
ParseAndRequireStringFunction · 0.85

Calls 5

ParseDateFunction · 0.92
relativeParseTimeFunction · 0.85
dateStyleFunction · 0.85
dateParseHelperFunction · 0.85
NewDDateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…