ColumnTypeScanType returns the value type that can be used to scan types into.
(index int)
| 695 | |
| 696 | // ColumnTypeScanType returns the value type that can be used to scan types into. |
| 697 | func (r *Rows) ColumnTypeScanType(index int) reflect.Type { |
| 698 | fd := r.rows.FieldDescriptions()[index] |
| 699 | |
| 700 | switch fd.DataTypeOID { |
| 701 | case pgtype.Float8OID: |
| 702 | return reflect.TypeFor[float64]() |
| 703 | case pgtype.Float4OID: |
| 704 | return reflect.TypeFor[float32]() |
| 705 | case pgtype.Int8OID: |
| 706 | return reflect.TypeFor[int64]() |
| 707 | case pgtype.Int4OID: |
| 708 | return reflect.TypeFor[int32]() |
| 709 | case pgtype.Int2OID: |
| 710 | return reflect.TypeFor[int16]() |
| 711 | case pgtype.BoolOID: |
| 712 | return reflect.TypeFor[bool]() |
| 713 | case pgtype.NumericOID: |
| 714 | return reflect.TypeFor[float64]() |
| 715 | case pgtype.DateOID, pgtype.TimestampOID, pgtype.TimestamptzOID: |
| 716 | return reflect.TypeFor[time.Time]() |
| 717 | case pgtype.ByteaOID: |
| 718 | return reflect.TypeFor[[]byte]() |
| 719 | default: |
| 720 | return reflect.TypeFor[string]() |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | func (r *Rows) Close() error { |
| 725 | r.rows.Close() |
nothing calls this directly
no test coverage detected