MCPcopy
hub / github.com/sqldef/sqldef / parseIdentList

Method parseIdentList

database/postgres/parser.go:968–978  ·  view source on GitHub ↗

parseIdentList converts a pgquery list of strings to []parser.Ident. pgquery doesn't preserve quoting information, so we assume unquoted (false).

(list *pgquery.List)

Source from the content-addressed store, hash-verified

966// parseIdentList converts a pgquery list of strings to []parser.Ident.
967// pgquery doesn't preserve quoting information, so we assume unquoted (false).
968func (p PostgresParser) parseIdentList(list *pgquery.List) ([]parser.Ident, error) {
969 var idents []parser.Ident
970 for _, node := range list.Items {
971 switch n := node.Node.(type) {
972 case *pgquery.Node_String_:
973 // pgquery doesn't preserve quoting info, assume unquoted
974 idents = append(idents, parser.NewIdent(n.String_.Sval, false))
975 }
976 }
977 return idents, nil
978}
979
980func (p PostgresParser) parseTableName(relation *pgquery.RangeVar) (parser.TableName, error) {
981 if relation.Catalogname != "" {

Callers 1

parseCommentStmtMethod · 0.95

Calls 1

NewIdentFunction · 0.92

Tested by

no test coverage detected