func (t *Tenant) FromRows(rows *sql.Rows) error {
	var scant struct {
		ID            int
		CreatedAt     sql.NullTime
		UpdatedAt     sql.NullTime
		Name          sql.NullString
		Domains       []byte
		Networks      []byte
		Tabs          []byte
		SSOCert       sql.NullString
		SSOEntryPoint sql.NullString
		SSOIssuer     sql.NullString
	}
	// the order here should be the same as in the `tenant.Columns`.
	if err := rows.Scan(
		&scant.ID,
		&scant.CreatedAt,
		&scant.UpdatedAt,
		&scant.Name,
		&scant.Domains,
		&scant.Networks,
		&scant.Tabs,
		&scant.SSOCert,
		&scant.SSOEntryPoint,
		&scant.SSOIssuer,
	); err != nil {
		return err
	}
	t.ID = scant.ID
	t.CreatedAt = scant.CreatedAt.Time
	t.UpdatedAt = scant.UpdatedAt.Time
	t.Name = scant.Name.String
	if value := scant.Domains; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Domains); err != nil {
			return fmt.Errorf("unmarshal field domains: %v", err)
		}
	}
	if value := scant.Networks; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Networks); err != nil {
			return fmt.Errorf("unmarshal field networks: %v", err)
		}
	}
	if value := scant.Tabs; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Tabs); err != nil {
			return fmt.Errorf("unmarshal field tabs: %v", err)
		}
	}
	t.SSOCert = scant.SSOCert.String
	t.SSOEntryPoint = scant.SSOEntryPoint.String
	t.SSOIssuer = scant.SSOIssuer.String
	return nil
}
// FromRows scans the sql response data into Tenant.
FromRows scans the sql response data into Tenant.
// FromRows scans the sql response data into Tenant .
func (t *Tenant) FromRows(rows *sql.Rows) error {
	var scant struct {
		ID            int
		CreatedAt     sql.NullTime
		UpdatedAt     sql.NullTime
		Name          sql.NullString
		Domains       []byte
		Networks      []byte
		Tabs          []byte
		SSOCert       sql.NullString
		SSOEntryPoint sql.NullString
		SSOIssuer     sql.NullString
	}
	if err := rows.Scan(
		&scant.ID,
		&scant.CreatedAt,
		&scant.UpdatedAt,
		&scant.Name,
		&scant.Domains,
		&scant.Networks,
		&scant.Tabs,
		&scant.SSOCert,
		&scant.SSOEntryPoint,
		&scant.SSOIssuer,
	); err != nil {
		return err
	}
	t.ID = scant.ID
	t.CreatedAt = scant.CreatedAt.Time
	t.UpdatedAt = scant.UpdatedAt.Time
	t.Name = scant.Name.String
	if value := scant.Domains; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Domains); err != nil {
			return fmt.Errorf("unmarshal field domains: %v", err)
		}
	}
	if value := scant.Networks; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Networks); err != nil {
			return fmt.Errorf("unmarshal field networks: %v", err)
		}
	}
	if value := scant.Tabs; len(value) > 0 {
		if err := json.Unmarshal(value, &t.Tabs); err != nil {
			return fmt.Errorf("unmarshal field tabs: %v", err)
		}
	}
	t.SSOCert = scant.SSOCert.String
	t.SSOEntryPoint = scant.SSOEntryPoint.String
	t.SSOIssuer = scant.SSOIssuer.String
	return nil
}
func ( t * Tenant ) FromRows ( rows * sql . Rows ) error { var scant struct { ID int CreatedAt sql . NullTime UpdatedAt sql . NullTime Name sql . NullString Domains [ ] byte Networks [ ] byte Tabs [ ] byte SSOCert sql . NullString SSOEntryPoint sql . NullString SSOIssuer sql . NullString } if err := rows . Scan ( & scant . ID , & scant . CreatedAt , & scant . UpdatedAt , & scant . Name , & scant . Domains , & scant . Networks , & scant . Tabs , & scant . SSOCert , & scant . SSOEntryPoint , & scant . SSOIssuer , ) ; err != nil { return err } t . ID = scant . ID t . CreatedAt = scant . CreatedAt . Time t . UpdatedAt = scant . UpdatedAt . Time t . Name = scant . Name . String if value := scant . Domains ; len ( value ) > 0 { if err := json . Unmarshal ( value , & t . Domains ) ; err != nil { return fmt . Errorf ( " " , err ) } } if value := scant . Networks ; len ( value ) > 0 { if err := json . Unmarshal ( value , & t . Networks ) ; err != nil { return fmt . Errorf ( " " , err ) } } if value := scant . Tabs ; len ( value ) > 0 { if err := json . Unmarshal ( value , & t . Tabs ) ; err != nil { return fmt . Errorf ( " " , err ) } } t . SSOCert = scant . SSOCert . String t . SSOEntryPoint = scant . SSOEntryPoint . String t . SSOIssuer = scant . SSOIssuer . String return nil }
FromRows scans the sql response data into Tenant.
FromRows scans the sql response data into Tenant .
// the order here should be the same as in the `tenant.Columns`.