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

Function ParseDIntervalWithTypeMetadata

pkg/sql/sem/tree/datum.go:2545–2552  ·  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

2543// types.IntervalTypeMetadata that both specifies the units for unitless, numeric intervals
2544// and also specifies the precision of the interval.
2545func ParseDIntervalWithTypeMetadata(s string, itm types.IntervalTypeMetadata) (*DInterval, error) {
2546 d, err := parseDInterval(s, itm)
2547 if err != nil {
2548 return nil, err
2549 }
2550 truncateDInterval(d, itm)
2551 return d, nil
2552}
2553
2554func parseDInterval(s string, itm types.IntervalTypeMetadata) (*DInterval, error) {
2555 // At this time the only supported interval formats are:

Callers 4

ParseMethod · 0.92
ParseDIntervalFunction · 0.85
ParseAndRequireStringFunction · 0.85
PerformCastFunction · 0.85

Calls 2

parseDIntervalFunction · 0.85
truncateDIntervalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…