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

Method parseTryCastExpression

pkg/sql/parser/expressions_complex.go:143–145  ·  view source on GitHub ↗

parseTryCastExpression parses a TRY_CAST expression with the same shape as CAST. Snowflake, SQL Server, and BigQuery return NULL on conversion failure instead of raising an error.

()

Source from the content-addressed store, hash-verified

141// CAST. Snowflake, SQL Server, and BigQuery return NULL on conversion failure
142// instead of raising an error.
143func (p *Parser) parseTryCastExpression() (*ast.CastExpression, error) {
144 return p.parseCastLike(true)
145}
146
147// parseCastLike implements the body shared between CAST and TRY_CAST. The
148// caller is responsible for ensuring the current token is the leading keyword.

Callers 1

Calls 1

parseCastLikeMethod · 0.95

Tested by

no test coverage detected