Files
amcs/internal/generatedmodels/sql_public_agent_persona_parts.go
T
Hein 3d4e6d0939
CI / build-and-test (push) Successful in 1m54s
Release / release (push) Successful in 3m12s
feat(sqltypes): add nullable SQL types with automatic casting
* Introduced SqlNull type for nullable values with auto-casting.
* Implemented JSON, YAML, and XML marshaling/unmarshaling.
* Added specific types for common SQL types (e.g., SqlInt64, SqlString).
* Included utility functions for creating nullable types.
* Added SqlTimeStamp, SqlDate, and SqlTime types with custom formatting.
2026-07-15 12:55:15 +02:00

65 lines
2.3 KiB
Go

// Code generated by relspecgo. DO NOT EDIT.
package generatedmodels
import (
"fmt"
sql_types "git.warky.dev/wdevs/relspecgo/pkg/sqltypes"
"github.com/uptrace/bun"
)
type ModelPublicAgentPersonaParts struct {
bun.BaseModel `bun:"table:public.agent_persona_parts,alias:agent_persona_parts"`
ID sql_types.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
PartID int64 `bun:"part_id,type:bigint,notnull," json:"part_id"`
PartOrder int32 `bun:"part_order,type:int,default:0,notnull," json:"part_order"`
PersonaID int64 `bun:"persona_id,type:bigint,notnull," json:"persona_id"`
Priority int32 `bun:"priority,type:int,default:0,notnull," json:"priority"`
RelPartID *ModelPublicAgentParts `bun:"rel:has-one,join:part_id=id" json:"relpartid,omitempty"` // Has one ModelPublicAgentParts
RelPersonaID *ModelPublicAgentPersonas `bun:"rel:has-one,join:persona_id=id" json:"relpersonaid,omitempty"` // Has one ModelPublicAgentPersonas
}
// TableName returns the table name for ModelPublicAgentPersonaParts
func (m ModelPublicAgentPersonaParts) TableName() string {
return "public.agent_persona_parts"
}
// TableNameOnly returns the table name without schema for ModelPublicAgentPersonaParts
func (m ModelPublicAgentPersonaParts) TableNameOnly() string {
return "agent_persona_parts"
}
// SchemaName returns the schema name for ModelPublicAgentPersonaParts
func (m ModelPublicAgentPersonaParts) SchemaName() string {
return "public"
}
// GetID returns the primary key value
func (m ModelPublicAgentPersonaParts) GetID() int64 {
return m.ID.Int64()
}
// GetIDStr returns the primary key as a string
func (m ModelPublicAgentPersonaParts) GetIDStr() string {
return m.ID.String()
}
// SetID sets the primary key value
func (m ModelPublicAgentPersonaParts) SetID(newid int64) {
m.UpdateID(newid)
}
// UpdateID updates the primary key value
func (m *ModelPublicAgentPersonaParts) UpdateID(newid int64) {
m.ID.FromString(fmt.Sprintf("%d", newid))
}
// GetIDName returns the name of the primary key column
func (m ModelPublicAgentPersonaParts) GetIDName() string {
return "id"
}
// GetPrefix returns the table prefix
func (m ModelPublicAgentPersonaParts) GetPrefix() string {
return "APP"
}