// Code generated by make codegen DO NOT EDIT.
// source: lib/column/codegen/array.tpl

package column

import (
	"database/sql"
	"database/sql/driver"
	"fmt"
	"github.com/ClickHouse/ch-go/proto"
	"github.com/google/uuid"
	"github.com/paulmach/orb"
	"github.com/shopspring/decimal"
	"math/big"
	"net"
	"net/netip"
	"time"
)

// appendRowPlain is a reflection-free realisation of append for plain arrays.
func (col *Array) appendRowPlain(v any) error {
	switch tv := v.(type) {
	case []float32:
		return appendRowPlain(col, tv)
	case []*float32:
		return appendNullableRowPlain(col, tv)
	case []float64:
		return appendRowPlain(col, tv)
	case []*float64:
		return appendNullableRowPlain(col, tv)
	case []int8:
		return appendRowPlain(col, tv)
	case []*int8:
		return appendNullableRowPlain(col, tv)
	case []int16:
		return appendRowPlain(col, tv)
	case []*int16:
		return appendNullableRowPlain(col, tv)
	case []int32:
		return appendRowPlain(col, tv)
	case []*int32:
		return appendNullableRowPlain(col, tv)
	case []int64:
		return appendRowPlain(col, tv)
	case []*int64:
		return appendNullableRowPlain(col, tv)
	case []uint8:
		return appendRowPlain(col, tv)
	case []*uint8:
		return appendNullableRowPlain(col, tv)
	case []uint16:
		return appendRowPlain(col, tv)
	case []*uint16:
		return appendNullableRowPlain(col, tv)
	case []uint32:
		return appendRowPlain(col, tv)
	case []*uint32:
		return appendNullableRowPlain(col, tv)
	case []uint64:
		return appendRowPlain(col, tv)
	case []*uint64:
		return appendNullableRowPlain(col, tv)
	case []string:
		return appendRowPlain(col, tv)
	case []*string:
		return appendNullableRowPlain(col, tv)
	case [][]byte:
		return appendRowPlain(col, tv)
	case []*[]byte:
		return appendNullableRowPlain(col, tv)
	case []sql.NullString:
		return appendRowPlain(col, tv)
	case []*sql.NullString:
		return appendNullableRowPlain(col, tv)
	case []int:
		return appendRowPlain(col, tv)
	case []*int:
		return appendNullableRowPlain(col, tv)
	case []uint:
		return appendRowPlain(col, tv)
	case []*uint:
		return appendNullableRowPlain(col, tv)
	case []big.Int:
		return appendRowPlain(col, tv)
	case []*big.Int:
		return appendNullableRowPlain(col, tv)
	case []decimal.Decimal:
		return appendRowPlain(col, tv)
	case []*decimal.Decimal:
		return appendNullableRowPlain(col, tv)
	case []bool:
		return appendRowPlain(col, tv)
	case []*bool:
		return appendNullableRowPlain(col, tv)
	case []sql.NullBool:
		return appendRowPlain(col, tv)
	case []*sql.NullBool:
		return appendNullableRowPlain(col, tv)
	case []time.Time:
		return appendRowPlain(col, tv)
	case []*time.Time:
		return appendNullableRowPlain(col, tv)
	case []sql.NullTime:
		return appendRowPlain(col, tv)
	case []*sql.NullTime:
		return appendNullableRowPlain(col, tv)
	case []uuid.UUID:
		return appendRowPlain(col, tv)
	case []*uuid.UUID:
		return appendNullableRowPlain(col, tv)
	case []netip.Addr:
		return appendRowPlain(col, tv)
	case []*netip.Addr:
		return appendNullableRowPlain(col, tv)
	case []net.IP:
		return appendRowPlain(col, tv)
	case []*net.IP:
		return appendNullableRowPlain(col, tv)
	case []proto.IPv6:
		return appendRowPlain(col, tv)
	case []*proto.IPv6:
		return appendNullableRowPlain(col, tv)
	case [][16]byte:
		return appendRowPlain(col, tv)
	case []*[16]byte:
		return appendNullableRowPlain(col, tv)
	case []orb.LineString:
		return appendRowPlain(col, tv)
	case []*orb.LineString:
		return appendNullableRowPlain(col, tv)
	case []orb.MultiLineString:
		return appendRowPlain(col, tv)
	case []*orb.MultiLineString:
		return appendNullableRowPlain(col, tv)
	case []orb.MultiPolygon:
		return appendRowPlain(col, tv)
	case []*orb.MultiPolygon:
		return appendNullableRowPlain(col, tv)
	case []orb.Point:
		return appendRowPlain(col, tv)
	case []*orb.Point:
		return appendNullableRowPlain(col, tv)
	case []orb.Polygon:
		return appendRowPlain(col, tv)
	case []*orb.Polygon:
		return appendNullableRowPlain(col, tv)
	case []orb.Ring:
		return appendRowPlain(col, tv)
	case []*orb.Ring:
		return appendNullableRowPlain(col, tv)
	default:
		if valuer, ok := v.(driver.Valuer); ok {
			val, err := valuer.Value()
			if err != nil {
				return &ColumnConverterError{
					Op:   "AppendRow",
					To:   "Array",
					From: fmt.Sprintf("%T", v),
					Hint: "could not get driver.Valuer value",
				}
			}
			return col.appendRowPlain(val)
		}
		return col.appendRowDefault(v)
	}
}
