Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pgtype/zeronull/int.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pgtype/zeronull/int.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ func (dst *Int<%= pg_byte_size %>) ScanInt64(n pgtype.Int8) error {
return nil
}

// Int64Value implements the [pgtype.Int64Valuer] interface.
func (src Int<%= pg_byte_size %>) Int64Value() (pgtype.Int8, error) {
if src == 0 {
return pgtype.Int8{}, nil
}
return pgtype.Int8{Int64: int64(src), Valid: true}, nil
}

// Scan implements the [database/sql.Scanner] interface.
func (dst *Int<%= pg_byte_size %>) Scan(src any) error {
if src == nil {
Expand Down
Loading