MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / CastExpression

Struct CastExpression

pkg/sql/ast/ast.go:1120–1124  ·  view source on GitHub ↗

CastExpression represents CAST(expr AS type) or TRY_CAST(expr AS type). Try is set when the expression originated from TRY_CAST (Snowflake / SQL Server / BigQuery), which returns NULL on conversion failure instead of raising an error.

Source from the content-addressed store, hash-verified

1118// Server / BigQuery), which returns NULL on conversion failure instead of
1119// raising an error.
1120type CastExpression struct {
1121 Expr Expression
1122 Type string
1123 Try bool
1124}
1125
1126func (c *CastExpression) expressionNode() {}
1127func (c CastExpression) TokenLiteral() string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected