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

Function MustAddExplicitTypeCast

server/functions/framework/cast.go:34–46  ·  view source on GitHub ↗

MustAddExplicitTypeCast registers the given explicit type cast. Panics if an error occurs.

(builtInCasts map[id.Cast]casts.Cast, cast TypeCast)

Source from the content-addressed store, hash-verified

32
33// MustAddExplicitTypeCast registers the given explicit type cast. Panics if an error occurs.
34func MustAddExplicitTypeCast(builtInCasts map[id.Cast]casts.Cast, cast TypeCast) {
35 castID := id.NewCast(cast.FromType.ID, cast.ToType.ID)
36 if _, ok := builtInCasts[castID]; ok {
37 panic("duplicate built-in cast")
38 }
39 builtInCasts[castID] = casts.Cast{
40 ID: castID,
41 CastType: casts.CastType_Explicit,
42 Function: id.NullFunction,
43 BuiltIn: cast.Function,
44 UseInOut: false,
45 }
46}
47
48// MustAddAssignmentTypeCast registers the given assignment type cast. Panics if an error occurs.
49func MustAddAssignmentTypeCast(builtInCasts map[id.Cast]casts.Cast, cast TypeCast) {

Callers 5

boolExplicitFunction · 0.92
jsonbExplicitFunction · 0.92
charExplicitFunction · 0.92
int32ExplicitFunction · 0.92
internalCharExplicitFunction · 0.92

Calls 1

NewCastFunction · 0.92

Tested by

no test coverage detected