1
0
This commit is contained in:
2024-04-11 06:54:13 +09:00
parent 9d1838f75d
commit 0e4f081101
15 changed files with 540 additions and 28 deletions

View File

@ -34,6 +34,8 @@ type Sev struct {
UID int `json:"uid,omitempty"`
// Cid holds the value of the "cid" field.
Cid int `json:"cid,omitempty"`
// Card holds the value of the "card" field.
Card int `json:"card,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// CreatedAt holds the value of the "created_at" field.
@ -74,7 +76,7 @@ func (*Sev) scanValues(columns []string) ([]any, error) {
switch columns[i] {
case sev.FieldLimit:
values[i] = new(sql.NullBool)
case sev.FieldID, sev.FieldCount, sev.FieldUID, sev.FieldCid:
case sev.FieldID, sev.FieldCount, sev.FieldUID, sev.FieldCid, sev.FieldCard:
values[i] = new(sql.NullInt64)
case sev.FieldPassword, sev.FieldToken, sev.FieldHandle, sev.FieldDid:
values[i] = new(sql.NullString)
@ -151,6 +153,12 @@ func (s *Sev) assignValues(columns []string, values []any) error {
} else if value.Valid {
s.Cid = int(value.Int64)
}
case sev.FieldCard:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field card", values[i])
} else if value.Valid {
s.Card = int(value.Int64)
}
case sev.FieldUpdatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
@ -233,6 +241,9 @@ func (s *Sev) String() string {
builder.WriteString("cid=")
builder.WriteString(fmt.Sprintf("%v", s.Cid))
builder.WriteString(", ")
builder.WriteString("card=")
builder.WriteString(fmt.Sprintf("%v", s.Card))
builder.WriteString(", ")
builder.WriteString("updated_at=")
builder.WriteString(s.UpdatedAt.Format(time.ANSIC))
builder.WriteString(", ")