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

Method parseCastExpression

pkg/sql/parser/expressions_complex.go:136–138  ·  view source on GitHub ↗

parseCastExpression parses a CAST expression: CAST(expr AS type) Examples: CAST(id AS VARCHAR) CAST(price AS DECIMAL(10,2)) CAST(name AS VARCHAR(100))

()

Source from the content-addressed store, hash-verified

134// CAST(price AS DECIMAL(10,2))
135// CAST(name AS VARCHAR(100))
136func (p *Parser) parseCastExpression() (*ast.CastExpression, error) {
137 return p.parseCastLike(false)
138}
139
140// parseTryCastExpression parses a TRY_CAST expression with the same shape as
141// CAST. Snowflake, SQL Server, and BigQuery return NULL on conversion failure

Callers 1

Calls 1

parseCastLikeMethod · 0.95

Tested by

no test coverage detected