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

Function IsDateTimeType

pkg/sql/types/types.go:1983–2000  ·  view source on GitHub ↗

IsDateTimeType returns true if the given type is a date or time-related type.

(t *T)

Source from the content-addressed store, hash-verified

1981
1982// IsDateTimeType returns true if the given type is a date or time-related type.
1983func IsDateTimeType(t *T) bool {
1984 switch t.Family() {
1985 case DateFamily:
1986 return true
1987 case TimeFamily:
1988 return true
1989 case TimeTZFamily:
1990 return true
1991 case TimestampFamily:
1992 return true
1993 case TimestampTZFamily:
1994 return true
1995 case IntervalFamily:
1996 return true
1997 default:
1998 return false
1999 }
2000}
2001
2002// IsAdditiveType returns true if the given type supports addition and
2003// subtraction.

Callers 1

IsAdditiveTypeFunction · 0.85

Calls 1

FamilyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…