regclassAssignment registers all assignment casts. This comprises only the source types.
(builtInCasts map[id.Cast]casts.Cast)
| 31 | |
| 32 | // regclassAssignment registers all assignment casts. This comprises only the source types. |
| 33 | func regclassAssignment(builtInCasts map[id.Cast]casts.Cast) { |
| 34 | framework.MustAddAssignmentTypeCast(builtInCasts, framework.TypeCast{ |
| 35 | FromType: pgtypes.Regclass, |
| 36 | ToType: pgtypes.Int32, |
| 37 | Function: func(ctx *sql.Context, val any, _, targetType *pgtypes.DoltgresType) (any, error) { |
| 38 | return int32(id.Cache().ToOID(val.(id.Id))), nil |
| 39 | }, |
| 40 | }) |
| 41 | framework.MustAddAssignmentTypeCast(builtInCasts, framework.TypeCast{ |
| 42 | FromType: pgtypes.Regclass, |
| 43 | ToType: pgtypes.Int64, |
| 44 | Function: func(ctx *sql.Context, val any, _, targetType *pgtypes.DoltgresType) (any, error) { |
| 45 | return int64(id.Cache().ToOID(val.(id.Id))), nil |
| 46 | }, |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | // regclassImplicit registers all implicit casts. This comprises only the source types. |
| 51 | func regclassImplicit(builtInCasts map[id.Cast]casts.Cast) { |
no test coverage detected