MCPcopy Create free account
hub / github.com/dolthub/doltgresql / ParseDIntervalWithTypeMetadata

Function ParseDIntervalWithTypeMetadata

postgres/parser/sem/tree/datum.go:1182–1189  ·  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.

(s string, itm types.IntervalTypeMetadata)

Source from the content-addressed store, hash-verified

1180// types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals
1181// and also specifies the precision of the interval.
1182func ParseDIntervalWithTypeMetadata(s string, itm types.IntervalTypeMetadata) (*DInterval, error) {
1183 d, err := parseDInterval(s, itm)
1184 if err != nil {
1185 return nil, err
1186 }
1187 truncateDInterval(d, itm)
1188 return d, nil
1189}
1190
1191func parseDInterval(s string, itm types.IntervalTypeMetadata) (*DInterval, error) {
1192 // At this time the only supported interval formats are:

Callers 2

ParseDIntervalFunction · 0.85
ParseAndRequireStringFunction · 0.85

Calls 2

parseDIntervalFunction · 0.85
truncateDIntervalFunction · 0.85

Tested by

no test coverage detected