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

Function applyNoticeOptions

server/plpgsql/interpreter_logic.go:414–443  ·  view source on GitHub ↗

applyNoticeOptions adds the specified |options| to the |noticeResponse|.

(ctx *sql.Context, noticeResponse *pgproto3.NoticeResponse, options map[string]string)

Source from the content-addressed store, hash-verified

412
413// applyNoticeOptions adds the specified |options| to the |noticeResponse|.
414func applyNoticeOptions(ctx *sql.Context, noticeResponse *pgproto3.NoticeResponse, options map[string]string) error {
415 for key, value := range options {
416 i, err := strconv.Atoi(key)
417 if err != nil {
418 return err
419 }
420
421 switch NoticeOptionType(i) {
422 case NoticeOptionTypeErrCode:
423 noticeResponse.Code = value
424 case NoticeOptionTypeMessage:
425 noticeResponse.Message = value
426 case NoticeOptionTypeDetail:
427 noticeResponse.Detail = value
428 case NoticeOptionTypeHint:
429 noticeResponse.Hint = value
430 case NoticeOptionTypeConstraint:
431 noticeResponse.ConstraintName = value
432 case NoticeOptionTypeDataType:
433 noticeResponse.DataTypeName = value
434 case NoticeOptionTypeTable:
435 noticeResponse.TableName = value
436 case NoticeOptionTypeSchema:
437 noticeResponse.SchemaName = value
438 default:
439 ctx.GetLogger().Warnf("unhandled notice option type: %s", key)
440 }
441 }
442 return nil
443}
444
445// evaluteNoticeMessage evaluates the message for a RAISE NOTICE statement, including
446// evaluating any specified parameters and plugging them into the message in place of

Callers 1

callFunction · 0.85

Calls 1

NoticeOptionTypeTypeAlias · 0.85

Tested by

no test coverage detected