applyNoticeOptions adds the specified |options| to the |noticeResponse|.
(ctx *sql.Context, noticeResponse *pgproto3.NoticeResponse, options map[string]string)
| 412 | |
| 413 | // applyNoticeOptions adds the specified |options| to the |noticeResponse|. |
| 414 | func 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 |
no test coverage detected