# sql: converting argument $1 type: unsupported type []byte, a slice of bytes

- **ID:** `go/database-sql-unsupported-type`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The database driver does not support a specific Go type passed as a query argument, such as []byte without proper conversion.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.17 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Convert []byte to a driver.Valuer: type ByteArray []byte; func (b ByteArray) Value() (driver.Value, error) { return []byte(b), nil }
   ```
2. **** (80% success)
   ```
   Use a driver-specific type like pq.ByteaArray for PostgreSQL: args = append(args, pq.ByteaArray(data))
   ```

## Dead Ends

- **** — May not preserve binary data and can cause encoding issues. (60% fail)
- **** — Doesn't solve the underlying type mismatch. (80% fail)
