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

Function ParseDInt

postgres/parser/sem/tree/datum.go:370–376  ·  view source on GitHub ↗

ParseDInt parses and returns the *DInt Datum value represented by the provided string, or an error if parsing is unsuccessful.

(s string)

Source from the content-addressed store, hash-verified

368// ParseDInt parses and returns the *DInt Datum value represented by the provided
369// string, or an error if parsing is unsuccessful.
370func ParseDInt(s string) (*DInt, error) {
371 i, err := strconv.ParseInt(s, 0, 64)
372 if err != nil {
373 return nil, makeParseError(s, types.Int, err)
374 }
375 return NewDInt(DInt(i)), nil
376}
377
378// ResolvedType implements the TypedExpr interface.
379func (*DInt) ResolvedType() *types.T {

Callers 1

ParseAndRequireStringFunction · 0.85

Calls 3

makeParseErrorFunction · 0.85
NewDIntFunction · 0.85
DIntTypeAlias · 0.85

Tested by

no test coverage detected