Skip to content

Commit

Permalink
fix(pgdialect): remove unsigned integer conversion
Browse files Browse the repository at this point in the history
PostgreSQL does not support unsigned integer types.
Previously, a Go uint32 type was mapped to the database
integer type. When values exceeded the range, they were
converted.
Even specifying the type as numeric did not prevent
this conversion. This update removes the conversion,
allowing the database to handle errors appropriately.

Fixed #624
  • Loading branch information
Aoang committed Dec 5, 2024
1 parent 96baf25 commit ab3c679
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions dialect/pgdialect/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pgdialect
import (
"database/sql"
"fmt"
"strconv"
"strings"

"github.com/uptrace/bun"
Expand Down Expand Up @@ -128,14 +127,6 @@ func (d *Dialect) IdentQuote() byte {
return '"'
}

func (d *Dialect) AppendUint32(b []byte, n uint32) []byte {
return strconv.AppendInt(b, int64(int32(n)), 10)
}

func (d *Dialect) AppendUint64(b []byte, n uint64) []byte {
return strconv.AppendInt(b, int64(n), 10)
}

func (d *Dialect) AppendSequence(b []byte, _ *schema.Table, _ *schema.Field) []byte {
return appendGeneratedAsIdentity(b)
}
Expand Down

0 comments on commit ab3c679

Please sign in to comment.