MCPcopy
hub / github.com/sqlc-dev/sqlc / Add

Method Add

internal/multierr/error.go:25–40  ·  view source on GitHub ↗
(filename, in string, loc int, err error)

Source from the content-addressed store, hash-verified

23}
24
25func (e *Error) Add(filename, in string, loc int, err error) {
26 line := 1
27 column := 1
28 if lerr, ok := err.(*sqlerr.Error); ok {
29 if lerr.Location != 0 {
30 loc = lerr.Location
31 } else if lerr.Line != 0 && lerr.Column != 0 {
32 line = lerr.Line
33 column = lerr.Column
34 }
35 }
36 if in != "" && loc != 0 {
37 line, column = source.LineNumber(in, loc)
38 }
39 e.errs = append(e.errs, &FileError{filename, line, column, err})
40}
41
42func (e *Error) Errs() []*FileError {
43 return e.errs

Callers 6

parseCatalogMethod · 0.45
parseQueriesMethod · 0.45
FuzzOverrideFunction · 0.45
FuzzConfigFunction · 0.45
waitForPostgreSQLFunction · 0.45
waitForMySQLFunction · 0.45

Calls 1

LineNumberFunction · 0.92

Tested by 2

FuzzOverrideFunction · 0.36
FuzzConfigFunction · 0.36