Skip to content

how use json null set sql time field to null? #70

Description

@ystyle
  1. defind web api dto struct
type Dto struct {
   Start null.Time
}
  1. send this json to web api
{ 
  "Start": null
}
  1. service: use gorm update entry
gorm.Model(&MyTable).Where("id = 1").Update(&dto)
  1. Hope to generate sql
update my_table set start = null  where id = 1

The start field is now ignored when used in this way

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions