| 42 | } |
| 43 | |
| 44 | func (c *JSONBCodec) PlanScan(m *Map, oid uint32, format int16, target any) ScanPlan { |
| 45 | switch format { |
| 46 | case BinaryFormatCode: |
| 47 | plan := (&JSONCodec{Marshal: c.Marshal, Unmarshal: c.Unmarshal}).PlanScan(m, oid, TextFormatCode, target) |
| 48 | if plan != nil { |
| 49 | return &scanPlanJSONBCodecBinaryUnwrapper{textPlan: plan} |
| 50 | } |
| 51 | case TextFormatCode: |
| 52 | return (&JSONCodec{Marshal: c.Marshal, Unmarshal: c.Unmarshal}).PlanScan(m, oid, format, target) |
| 53 | } |
| 54 | |
| 55 | return nil |
| 56 | } |
| 57 | |
| 58 | type scanPlanJSONBCodecBinaryUnwrapper struct { |
| 59 | textPlan ScanPlan |