func (pt *ProjectType) FromRows(rows *sql.Rows) error {
	var scanpt struct {
		ID          int
		CreateTime  sql.NullTime
		UpdateTime  sql.NullTime
		Name        sql.NullString
		Description sql.NullString
	}
	// the order here should be the same as in the `projecttype.Columns`.
	if err := rows.Scan(
		&scanpt.ID,
		&scanpt.CreateTime,
		&scanpt.UpdateTime,
		&scanpt.Name,
		&scanpt.Description,
	); err != nil {
		return err
	}
	pt.ID = strconv.Itoa(scanpt.ID)
	pt.CreateTime = scanpt.CreateTime.Time
	pt.UpdateTime = scanpt.UpdateTime.Time
	pt.Name = scanpt.Name.String
	if scanpt.Description.Valid {
		pt.Description = new(string)
		*pt.Description = scanpt.Description.String
	}
	return nil
}
// FromRows scans the sql response data into ProjectType.
FromRows scans the sql response data into ProjectType.
// FromRows scans the sql response data into ProjectType .
func (pt *ProjectType) FromRows(rows *sql.Rows) error {
	var scanpt struct {
		ID          int
		CreateTime  sql.NullTime
		UpdateTime  sql.NullTime
		Name        sql.NullString
		Description sql.NullString
	}
	if err := rows.Scan(
		&scanpt.ID,
		&scanpt.CreateTime,
		&scanpt.UpdateTime,
		&scanpt.Name,
		&scanpt.Description,
	); err != nil {
		return err
	}
	pt.ID = strconv.Itoa(scanpt.ID)
	pt.CreateTime = scanpt.CreateTime.Time
	pt.UpdateTime = scanpt.UpdateTime.Time
	pt.Name = scanpt.Name.String
	if scanpt.Description.Valid {
		pt.Description = new(string)
		*pt.Description = scanpt.Description.String
	}
	return nil
}
func ( pt * ProjectType ) FromRows ( rows * sql . Rows ) error { var scanpt struct { ID int CreateTime sql . NullTime UpdateTime sql . NullTime Name sql . NullString Description sql . NullString } if err := rows . Scan ( & scanpt . ID , & scanpt . CreateTime , & scanpt . UpdateTime , & scanpt . Name , & scanpt . Description , ) ; err != nil { return err } pt . ID = strconv . Itoa ( scanpt . ID ) pt . CreateTime = scanpt . CreateTime . Time pt . UpdateTime = scanpt . UpdateTime . Time pt . Name = scanpt . Name . String if scanpt . Description . Valid { pt . Description = new ( string ) * pt . Description = scanpt . Description . String } return nil }
FromRows scans the sql response data into ProjectType.
FromRows scans the sql response data into ProjectType .
// the order here should be the same as in the `projecttype.Columns`.