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

Function ParseDIntervalWithTypeMetadata

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

ParseDIntervalWithTypeMetadata is like ParseDInterval, but it also takes a types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals and also specifies the precision of the interval.

(
	style duration.IntervalStyle, s string, itm types.IntervalTypeMetadata,
)

Source from the content-addressed store, hash-verified

3181// types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals
3182// and also specifies the precision of the interval.
3183func ParseDIntervalWithTypeMetadata(
3184 style duration.IntervalStyle, s string, itm types.IntervalTypeMetadata,
3185) (*DInterval, error) {
3186 d, err := ParseIntervalWithTypeMetadata(style, s, itm)
3187 if err != nil {
3188 return nil, err
3189 }
3190 return &DInterval{Duration: d}, nil
3191}
3192
3193// ParseIntervalWithTypeMetadata is the same as ParseDIntervalWithTypeMetadata
3194// but returns a duration.Duration.

Callers 2

ParseDIntervalFunction · 0.85
ParseAndRequireStringFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…