storepb

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrencyConstraintPkey                 = "currency_pkey"
	UserConstraintPkey                     = "users_pkey"
	UserConstraintEmailKey                 = "users_email_key"
	UserConstraintEmailIdx                 = "idx_users_email"
	ProfileConstraintPkey                  = "profiles_pkey"
	ProfileConstraintUserIdIdx             = "idx_profiles_user_id"
	CategoryConstraintPkey                 = "categories_pkey"
	CategoryConstraintSlugKey              = "categories_slug_key"
	TagConstraintPkey                      = "tags_pkey"
	TagConstraintSlugKey                   = "tags_slug_key"
	ProductConstraintPkey                  = "products_pkey"
	ProductConstraintSkuKey                = "products_sku_key"
	ProductConstraintCheck                 = "products_check"
	OrderConstraintPkey                    = "orders_pkey"
	OrderConstraintCheck                   = "orders_check"
	OrderItemConstraintOrderIdProductIdKey = "order_items_order_id_product_id_key"
	OrderItemConstraintPkey                = "order_items_pkey"
	OrderItemConstraintCheck               = "order_items_check"
	OrderItemConstraintCheck1              = "order_items_check1"
)

Variables

View Source
var (
	ErrCurrencyPrimaryKey              = errors.New("primary key constraint violated: currency_pkey")
	ErrUserPrimaryKey                  = errors.New("primary key constraint violated: users_pkey")
	ErrUserEmailUnique                 = errors.New("unique constraint violated: users_email_key")
	ErrUserEmailUniqueIdx              = errors.New("unique constraint violated: idx_users_email")
	ErrProfilePrimaryKey               = errors.New("primary key constraint violated: profiles_pkey")
	ErrProfileUserIdUniqueIdx          = errors.New("unique constraint violated: idx_profiles_user_id")
	ErrCategoryPrimaryKey              = errors.New("primary key constraint violated: categories_pkey")
	ErrCategorySlugUnique              = errors.New("unique constraint violated: categories_slug_key")
	ErrTagPrimaryKey                   = errors.New("primary key constraint violated: tags_pkey")
	ErrTagSlugUnique                   = errors.New("unique constraint violated: tags_slug_key")
	ErrProductPrimaryKey               = errors.New("primary key constraint violated: products_pkey")
	ErrProductSkuUnique                = errors.New("unique constraint violated: products_sku_key")
	ErrProductCheck                    = errors.New("check constraint violated: products_check")
	ErrOrderPrimaryKey                 = errors.New("primary key constraint violated: orders_pkey")
	ErrOrderCheck                      = errors.New("check constraint violated: orders_check")
	ErrOrderItemOrderIdProductIdUnique = errors.New("unique constraint violated: order_items_order_id_product_id_key")
	ErrOrderItemPrimaryKey             = errors.New("primary key constraint violated: order_items_pkey")
	ErrOrderItemCheck                  = errors.New("check constraint violated: order_items_check")
	ErrOrderItemCheck1                 = errors.New("check constraint violated: order_items_check1")
)
View Source
var CategoryConverter = repository.Converter[*CategoryScanner, *Category]{
	ToScanner: (*Category).IntoPlain,
	ToProto:   (*CategoryScanner).IntoPb,
}

CategoryConverter provides conversion between Category and CategoryScanner

View Source
var Categorys = func() CategorysTable {
	idCol := schema.BigSerialColumn(CategoryColumnId, ddl.WithPrimaryKey[CategoryColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(CategoryColumnCreatedAt, ddl.WithDefault[CategoryColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(CategoryColumnUpdatedAt, ddl.WithDefault[CategoryColumnAlias]("now()"))
	nameCol := schema.TextColumn(CategoryColumnName)
	slugCol := schema.TextColumn(CategoryColumnSlug, ddl.WithUnique[CategoryColumnAlias]())
	parentIdCol := schema.NullBigIntColumn(CategoryColumnParentId)

	return CategorysTable{
		Table: schema.NewTable[CategoryAlias, CategoryColumnAlias, *CategoryScanner](
			CategoryAliasName,
			func() *CategoryScanner { return &CategoryScanner{} },
			[]*ddl.ColumnDDL[CategoryColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				nameCol.DDL(),
				slugCol.DDL(),
				parentIdCol.DDL(),
			},
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		Name:      nameCol,
		Slug:      slugCol,
		ParentId:  parentIdCol,
	}
}()

Categorys is the global categories table instance

CategorysRef is a reference to the categories table for relations

View Source
var CurrencyConverter = repository.Converter[*CurrencyScanner, *Currency]{
	ToScanner: (*Currency).IntoPlain,
	ToProto:   (*CurrencyScanner).IntoPb,
}

CurrencyConverter provides conversion between Currency and CurrencyScanner

View Source
var Currencys = func() CurrencysTable {
	codeCol := schema.TextColumn(CurrencyColumnCode, ddl.WithPrimaryKey[CurrencyColumnAlias]())
	nameCol := schema.TextColumn(CurrencyColumnName)

	return CurrencysTable{
		Table: schema.NewTable[CurrencyAlias, CurrencyColumnAlias, *CurrencyScanner](
			CurrencyAliasName,
			func() *CurrencyScanner { return &CurrencyScanner{} },
			[]*ddl.ColumnDDL[CurrencyColumnAlias]{
				codeCol.DDL(),
				nameCol.DDL(),
			},
		),
		Code: codeCol,
		Name: nameCol,
	}
}()

Currencys is the global currency table instance

CurrencysRef is a reference to the currency table for relations

View Source
var File_examples_proto_store_proto protoreflect.FileDescriptor
View Source
var OrderConverter = repository.Converter[*OrderScanner, *Order]{
	ToScanner: (*Order).IntoPlain,
	ToProto:   (*OrderScanner).IntoPb,
}

OrderConverter provides conversion between Order and OrderScanner

OrderCurrency defines the belongs-to relationship: Order belongs to Currency

View Source
var OrderItemConverter = repository.Converter[*OrderItemScanner, *OrderItem]{
	ToScanner: (*OrderItem).IntoPlain,
	ToProto:   (*OrderItemScanner).IntoPb,
}

OrderItemConverter provides conversion between OrderItem and OrderItemScanner

OrderItemOrder defines the belongs-to relationship: OrderItem belongs to Order

OrderItemProduct defines the belongs-to relationship: OrderItem belongs to Product

OrderItems is the global order_items table instance

OrderItemsRef is a reference to the order_items table for relations

OrderOrderItems defines the one-to-many relationship: Order has many OrderItem

OrderUser defines the belongs-to relationship: Order belongs to User

View Source
var Orders = func() OrdersTable {
	idCol := schema.BigSerialColumn(OrderColumnId, ddl.WithPrimaryKey[OrderColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(OrderColumnCreatedAt, ddl.WithDefault[OrderColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(OrderColumnUpdatedAt, ddl.WithDefault[OrderColumnAlias]("now()"))
	userIdCol := schema.BigIntColumn(OrderColumnUserId)
	statusCol := schema.TextColumn(OrderColumnStatus, ddl.WithDefault[OrderColumnAlias]("'NEW'"))
	currencyCol := schema.TextColumn(OrderColumnCurrency)

	idx0 := ddl.NewIndex[OrderAlias, OrderColumnAlias]("idx_orders_user_id", OrderAliasName).OnColumns(OrderColumnUserId)
	idx1 := ddl.NewIndex[OrderAlias, OrderColumnAlias]("idx_orders_status", OrderAliasName).OnColumns(OrderColumnStatus)
	idx2 := ddl.NewIndex[OrderAlias, OrderColumnAlias]("idx_orders_created_at", OrderAliasName).OnColumns(OrderColumnCreatedAt)

	return OrdersTable{
		Table: schema.NewTable[OrderAlias, OrderColumnAlias, *OrderScanner](
			OrderAliasName,
			func() *OrderScanner { return &OrderScanner{} },
			[]*ddl.ColumnDDL[OrderColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				userIdCol.DDL(),
				statusCol.DDL(),
				currencyCol.DDL(),
			},
			ddl.WithIndexes[OrderAlias, OrderColumnAlias](
				idx0,
				idx1,
				idx2,
			),
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		UserId:    userIdCol,
		Status:    statusCol,
		Currency:  currencyCol,
	}
}()

Orders is the global orders table instance

OrdersRef is a reference to the orders table for relations

View Source
var ProductConverter = repository.Converter[*ProductScanner, *Product]{
	ToScanner: (*Product).IntoPlain,
	ToProto:   (*ProductScanner).IntoPb,
}

ProductConverter provides conversion between Product and ProductScanner

View Source
var Products = func() ProductsTable {
	idCol := schema.BigSerialColumn(ProductColumnId, ddl.WithPrimaryKey[ProductColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(ProductColumnCreatedAt, ddl.WithDefault[ProductColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(ProductColumnUpdatedAt, ddl.WithDefault[ProductColumnAlias]("now()"))
	skuCol := schema.TextColumn(ProductColumnSku, ddl.WithUnique[ProductColumnAlias]())
	nameCol := schema.TextColumn(ProductColumnName)
	priceCol := schema.DoublePrecisionColumn(ProductColumnPrice)
	currencyCol := schema.TextColumn(ProductColumnCurrency)
	stockQtyCol := schema.IntegerColumn(ProductColumnStockQty, ddl.WithDefault[ProductColumnAlias]("0"))
	isDeletedCol := schema.BooleanColumn(ProductColumnIsDeleted, ddl.WithDefault[ProductColumnAlias]("false"))

	idx0 := ddl.NewIndex[ProductAlias, ProductColumnAlias]("idx_products_sku", ProductAliasName).OnColumns(ProductColumnSku)
	idx1 := ddl.NewIndex[ProductAlias, ProductColumnAlias]("idx_products_currency", ProductAliasName).OnColumns(ProductColumnCurrency)
	idx2 := ddl.NewIndex[ProductAlias, ProductColumnAlias]("idx_products_is_deleted_created_at", ProductAliasName).OnColumns(ProductColumnIsDeleted, ProductColumnCreatedAt)
	idx2 = idx2.Where("is_deleted = false")

	return ProductsTable{
		Table: schema.NewTable[ProductAlias, ProductColumnAlias, *ProductScanner](
			ProductAliasName,
			func() *ProductScanner { return &ProductScanner{} },
			[]*ddl.ColumnDDL[ProductColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				skuCol.DDL(),
				nameCol.DDL(),
				priceCol.DDL(),
				currencyCol.DDL(),
				stockQtyCol.DDL(),
				isDeletedCol.DDL(),
			},
			ddl.WithIndexes[ProductAlias, ProductColumnAlias](
				idx0,
				idx1,
				idx2,
			),
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		Sku:       skuCol,
		Name:      nameCol,
		Price:     priceCol,
		Currency:  currencyCol,
		StockQty:  stockQtyCol,
		IsDeleted: isDeletedCol,
	}
}()

Products is the global products table instance

ProductsRef is a reference to the products table for relations

View Source
var ProfileConverter = repository.Converter[*ProfileScanner, *Profile]{
	ToScanner: (*Profile).IntoPlain,
	ToProto:   (*ProfileScanner).IntoPb,
}

ProfileConverter provides conversion between Profile and ProfileScanner

ProfileUser defines the belongs-to relationship: Profile belongs to User

View Source
var Profiles = func() ProfilesTable {
	idCol := schema.BigSerialColumn(ProfileColumnId, ddl.WithPrimaryKey[ProfileColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(ProfileColumnCreatedAt, ddl.WithDefault[ProfileColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(ProfileColumnUpdatedAt, ddl.WithDefault[ProfileColumnAlias]("now()"))
	userIdCol := schema.BigIntColumn(ProfileColumnUserId)
	bioCol := schema.TextColumn(ProfileColumnBio)
	avatarUrlCol := schema.TextColumn(ProfileColumnAvatarUrl)

	idx0 := ddl.NewIndex[ProfileAlias, ProfileColumnAlias]("idx_profiles_user_id", ProfileAliasName).OnColumns(ProfileColumnUserId)
	idx0 = idx0.Unique()

	return ProfilesTable{
		Table: schema.NewTable[ProfileAlias, ProfileColumnAlias, *ProfileScanner](
			ProfileAliasName,
			func() *ProfileScanner { return &ProfileScanner{} },
			[]*ddl.ColumnDDL[ProfileColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				userIdCol.DDL(),
				bioCol.DDL(),
				avatarUrlCol.DDL(),
			},
			ddl.WithIndexes[ProfileAlias, ProfileColumnAlias](
				idx0,
			),
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		UserId:    userIdCol,
		Bio:       bioCol,
		AvatarUrl: avatarUrlCol,
	}
}()

Profiles is the global profiles table instance

ProfilesRef is a reference to the profiles table for relations

View Source
var TagConverter = repository.Converter[*TagScanner, *Tag]{
	ToScanner: (*Tag).IntoPlain,
	ToProto:   (*TagScanner).IntoPb,
}

TagConverter provides conversion between Tag and TagScanner

View Source
var Tags = func() TagsTable {
	idCol := schema.BigSerialColumn(TagColumnId, ddl.WithPrimaryKey[TagColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(TagColumnCreatedAt, ddl.WithDefault[TagColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(TagColumnUpdatedAt, ddl.WithDefault[TagColumnAlias]("now()"))
	nameCol := schema.TextColumn(TagColumnName)
	slugCol := schema.TextColumn(TagColumnSlug, ddl.WithUnique[TagColumnAlias]())

	return TagsTable{
		Table: schema.NewTable[TagAlias, TagColumnAlias, *TagScanner](
			TagAliasName,
			func() *TagScanner { return &TagScanner{} },
			[]*ddl.ColumnDDL[TagColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				nameCol.DDL(),
				slugCol.DDL(),
			},
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		Name:      nameCol,
		Slug:      slugCol,
	}
}()

Tags is the global tags table instance

TagsRef is a reference to the tags table for relations

View Source
var UserConverter = repository.Converter[*UserScanner, *User]{
	ToScanner: (*User).IntoPlain,
	ToProto:   (*UserScanner).IntoPb,
}

UserConverter provides conversion between User and UserScanner

UserOrders defines the one-to-many relationship: User has many Order

UserProfile defines the one-to-one relationship: User has one Profile

View Source
var Users = func() UsersTable {
	idCol := schema.BigSerialColumn(UserColumnId, ddl.WithPrimaryKey[UserColumnAlias]())
	createdAtCol := schema.TimestamptzColumn(UserColumnCreatedAt, ddl.WithDefault[UserColumnAlias]("now()"))
	updatedAtCol := schema.TimestamptzColumn(UserColumnUpdatedAt, ddl.WithDefault[UserColumnAlias]("now()"))
	emailCol := schema.TextColumn(UserColumnEmail, ddl.WithUnique[UserColumnAlias]())
	fullNameCol := schema.TextColumn(UserColumnFullName)
	isActiveCol := schema.BooleanColumn(UserColumnIsActive, ddl.WithDefault[UserColumnAlias]("true"))

	idx0 := ddl.NewIndex[UserAlias, UserColumnAlias]("idx_users_email", UserAliasName).OnColumns(UserColumnEmail)
	idx0 = idx0.Unique()
	idx1 := ddl.NewIndex[UserAlias, UserColumnAlias]("idx_users_is_active_created_at", UserAliasName).OnColumns(UserColumnIsActive, UserColumnCreatedAt)

	return UsersTable{
		Table: schema.NewTable[UserAlias, UserColumnAlias, *UserScanner](
			UserAliasName,
			func() *UserScanner { return &UserScanner{} },
			[]*ddl.ColumnDDL[UserColumnAlias]{
				idCol.DDL(),
				createdAtCol.DDL(),
				updatedAtCol.DDL(),
				emailCol.DDL(),
				fullNameCol.DDL(),
				isActiveCol.DDL(),
			},
			ddl.WithIndexes[UserAlias, UserColumnAlias](
				idx0,
				idx1,
			),
		),
		Id:        idCol,
		CreatedAt: createdAtCol,
		UpdatedAt: updatedAtCol,
		Email:     emailCol,
		FullName:  fullNameCol,
		IsActive:  isActiveCol,
	}
}()

Users is the global users table instance

UsersRef is a reference to the users table for relations

Functions

func IsCategoryPrimaryKeyError added in v0.2.0

func IsCategoryPrimaryKeyError(err error) bool

IsCategoryPrimaryKeyError checks if the error is a primary_key constraint violation on categories

func IsCategorySlugUniqueError added in v0.2.0

func IsCategorySlugUniqueError(err error) bool

IsCategorySlugUniqueError checks if the error is a unique constraint violation on categories

func IsCurrencyPrimaryKeyError added in v0.2.0

func IsCurrencyPrimaryKeyError(err error) bool

IsCurrencyPrimaryKeyError checks if the error is a primary_key constraint violation on currency

func IsOrderCheckError added in v0.2.0

func IsOrderCheckError(err error) bool

IsOrderCheckError checks if the error is a check constraint violation on orders

func IsOrderItemCheck1Error added in v0.2.0

func IsOrderItemCheck1Error(err error) bool

IsOrderItemCheck1Error checks if the error is a check constraint violation on order_items

func IsOrderItemCheckError added in v0.2.0

func IsOrderItemCheckError(err error) bool

IsOrderItemCheckError checks if the error is a check constraint violation on order_items

func IsOrderItemOrderIdProductIdUniqueError added in v0.2.0

func IsOrderItemOrderIdProductIdUniqueError(err error) bool

IsOrderItemOrderIdProductIdUniqueError checks if the error is a unique constraint violation on order_items

func IsOrderItemPrimaryKeyError added in v0.2.0

func IsOrderItemPrimaryKeyError(err error) bool

IsOrderItemPrimaryKeyError checks if the error is a primary_key constraint violation on order_items

func IsOrderPrimaryKeyError added in v0.2.0

func IsOrderPrimaryKeyError(err error) bool

IsOrderPrimaryKeyError checks if the error is a primary_key constraint violation on orders

func IsProductCheckError added in v0.2.0

func IsProductCheckError(err error) bool

IsProductCheckError checks if the error is a check constraint violation on products

func IsProductPrimaryKeyError added in v0.2.0

func IsProductPrimaryKeyError(err error) bool

IsProductPrimaryKeyError checks if the error is a primary_key constraint violation on products

func IsProductSkuUniqueError added in v0.2.0

func IsProductSkuUniqueError(err error) bool

IsProductSkuUniqueError checks if the error is a unique constraint violation on products

func IsProfilePrimaryKeyError added in v0.2.0

func IsProfilePrimaryKeyError(err error) bool

IsProfilePrimaryKeyError checks if the error is a primary_key constraint violation on profiles

func IsProfileUserIdUniqueIdxError added in v0.2.0

func IsProfileUserIdUniqueIdxError(err error) bool

IsProfileUserIdUniqueIdxError checks if the error is a unique constraint violation on profiles

func IsTagPrimaryKeyError added in v0.2.0

func IsTagPrimaryKeyError(err error) bool

IsTagPrimaryKeyError checks if the error is a primary_key constraint violation on tags

func IsTagSlugUniqueError added in v0.2.0

func IsTagSlugUniqueError(err error) bool

IsTagSlugUniqueError checks if the error is a unique constraint violation on tags

func IsUserEmailUniqueError added in v0.2.0

func IsUserEmailUniqueError(err error) bool

IsUserEmailUniqueError checks if the error is a unique constraint violation on users

func IsUserEmailUniqueIdxError added in v0.2.0

func IsUserEmailUniqueIdxError(err error) bool

IsUserEmailUniqueIdxError checks if the error is a unique constraint violation on users

func IsUserPrimaryKeyError added in v0.2.0

func IsUserPrimaryKeyError(err error) bool

IsUserPrimaryKeyError checks if the error is a primary_key constraint violation on users

func OrderItemsWithAllRelations added in v0.2.0

func OrderItemsWithAllRelations() exec.QueryOption[OrderItemColumnAlias, *OrderItemScanner]

OrderItemsWithAllRelations returns a QueryOption to load all relations

func OrderItemsWithOrder added in v0.2.0

func OrderItemsWithOrder() exec.QueryOption[OrderItemColumnAlias, *OrderItemScanner]

OrderItemsWithOrder returns a QueryOption to load Order relation

func OrderItemsWithProduct added in v0.2.0

func OrderItemsWithProduct() exec.QueryOption[OrderItemColumnAlias, *OrderItemScanner]

OrderItemsWithProduct returns a QueryOption to load Product relation

func OrdersWithAllRelations added in v0.2.0

func OrdersWithAllRelations() exec.QueryOption[OrderColumnAlias, *OrderScanner]

OrdersWithAllRelations returns a QueryOption to load all relations

func OrdersWithItems added in v0.2.0

func OrdersWithItems() exec.QueryOption[OrderColumnAlias, *OrderScanner]

OrdersWithItems returns a QueryOption to load Items relation

func OrdersWithMoney added in v0.2.0

func OrdersWithMoney() exec.QueryOption[OrderColumnAlias, *OrderScanner]

OrdersWithMoney returns a QueryOption to load Money relation

func OrdersWithUser added in v0.2.0

func OrdersWithUser() exec.QueryOption[OrderColumnAlias, *OrderScanner]

OrdersWithUser returns a QueryOption to load User relation

func ProfilesWithAllRelations added in v0.2.0

func ProfilesWithAllRelations() exec.QueryOption[ProfileColumnAlias, *ProfileScanner]

ProfilesWithAllRelations returns a QueryOption to load all relations

func ProfilesWithUser added in v0.2.0

func ProfilesWithUser() exec.QueryOption[ProfileColumnAlias, *ProfileScanner]

ProfilesWithUser returns a QueryOption to load User relation

func UsersWithAllRelations added in v0.2.0

func UsersWithAllRelations() exec.QueryOption[UserColumnAlias, *UserScanner]

UsersWithAllRelations returns a QueryOption to load all relations

func UsersWithOrders added in v0.2.0

func UsersWithOrders() exec.QueryOption[UserColumnAlias, *UserScanner]

UsersWithOrders returns a QueryOption to load Orders relation

func UsersWithProfile added in v0.2.0

func UsersWithProfile() exec.QueryOption[UserColumnAlias, *UserScanner]

UsersWithProfile returns a QueryOption to load Profile relation

Types

type BaseEntity

type BaseEntity struct {
	Id         *EntityID   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Timestamps *Timestamps `protobuf:"bytes,2,opt,name=timestamps,proto3" json:"timestamps,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ BaseEntity - базовая сущность с ID и timestamps (nested embed) ============================================================================

func (*BaseEntity) Descriptor deprecated

func (*BaseEntity) Descriptor() ([]byte, []int)

Deprecated: Use BaseEntity.ProtoReflect.Descriptor instead.

func (*BaseEntity) GetId

func (x *BaseEntity) GetId() *EntityID

func (*BaseEntity) GetTimestamps

func (x *BaseEntity) GetTimestamps() *Timestamps

func (*BaseEntity) IntoPlain

func (pb *BaseEntity) IntoPlain() *BaseEntityScanner

IntoPlain converts protobuf message to plain struct

func (*BaseEntity) ProtoMessage

func (*BaseEntity) ProtoMessage()

func (*BaseEntity) ProtoReflect

func (x *BaseEntity) ProtoReflect() protoreflect.Message

func (*BaseEntity) Reset

func (x *BaseEntity) Reset()

func (*BaseEntity) String

func (x *BaseEntity) String() string

type BaseEntityScanner

type BaseEntityScanner struct {
	Id        int64     `json:"id"` // origin: type_alias, empath: id
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

============================================================================

BaseEntity - базовая сущность с ID и timestamps (nested embed)
============================================================================

func (*BaseEntityScanner) IntoPb

func (p *BaseEntityScanner) IntoPb() *BaseEntity

IntoPb converts plain struct to protobuf message

type Category

type Category struct {

	// Embedded BaseEntity (id + timestamps)
	Base     *BaseEntity            `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	Name     string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Slug     string                 `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
	ParentId *wrapperspb.Int64Value `protobuf:"bytes,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Category - категория товаров (с BaseEntity) ============================================================================

func (*Category) Descriptor deprecated

func (*Category) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetBase

func (x *Category) GetBase() *BaseEntity

func (*Category) GetName

func (x *Category) GetName() string

func (*Category) GetParentId

func (x *Category) GetParentId() *wrapperspb.Int64Value

func (*Category) GetSlug

func (x *Category) GetSlug() string

func (*Category) IntoPlain

func (pb *Category) IntoPlain() *CategoryScanner

IntoPlain converts protobuf message to plain struct

func (*Category) ProtoMessage

func (*Category) ProtoMessage()

func (*Category) ProtoReflect

func (x *Category) ProtoReflect() protoreflect.Message

func (*Category) Reset

func (x *Category) Reset()

func (*Category) String

func (x *Category) String() string

type CategoryAlias

type CategoryAlias string

CategoryAlias is the table alias type for the categories table

const CategoryAliasName CategoryAlias = "categories"

func (CategoryAlias) String

func (a CategoryAlias) String() string

type CategoryColumnAlias

type CategoryColumnAlias string

CategoryColumnAlias represents column names for the categories table

const (
	CategoryColumnId        CategoryColumnAlias = "id"
	CategoryColumnCreatedAt CategoryColumnAlias = "created_at"
	CategoryColumnUpdatedAt CategoryColumnAlias = "updated_at"
	CategoryColumnName      CategoryColumnAlias = "name"
	CategoryColumnSlug      CategoryColumnAlias = "slug"
	CategoryColumnParentId  CategoryColumnAlias = "parent_id"
)

func (CategoryColumnAlias) String

func (c CategoryColumnAlias) String() string

type CategoryScanner

type CategoryScanner struct {
	Id        int64     `json:"id"` // origin: embed, empath: id
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Name      string    `json:"name"`
	Slug      string    `json:"slug"`
	ParentId  int64     `json:"parentId"`
}

============================================================================

Category - категория товаров (с BaseEntity)
============================================================================

func (*CategoryScanner) GetSetter

func (*CategoryScanner) GetTarget

func (s *CategoryScanner) GetTarget(col string) func() any

func (*CategoryScanner) GetValue

func (s *CategoryScanner) GetValue(f CategoryColumnAlias) func() any

func (*CategoryScanner) IntoPb

func (p *CategoryScanner) IntoPb() *Category

IntoPb converts plain struct to protobuf message

func (*CategoryScanner) Relations

Relations returns the relation loaders for the categories table

type Currency

type Currency struct {
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Currency - справочник валют (не использует BaseEntity) ============================================================================

func (*Currency) Descriptor deprecated

func (*Currency) Descriptor() ([]byte, []int)

Deprecated: Use Currency.ProtoReflect.Descriptor instead.

func (*Currency) GetCode

func (x *Currency) GetCode() string

func (*Currency) GetName

func (x *Currency) GetName() string

func (*Currency) IntoPlain

func (pb *Currency) IntoPlain() *CurrencyScanner

IntoPlain converts protobuf message to plain struct

func (*Currency) ProtoMessage

func (*Currency) ProtoMessage()

func (*Currency) ProtoReflect

func (x *Currency) ProtoReflect() protoreflect.Message

func (*Currency) Reset

func (x *Currency) Reset()

func (*Currency) String

func (x *Currency) String() string

type CurrencyAlias

type CurrencyAlias string

CurrencyAlias is the table alias type for the currency table

const CurrencyAliasName CurrencyAlias = "currency"

func (CurrencyAlias) String

func (a CurrencyAlias) String() string

type CurrencyColumnAlias

type CurrencyColumnAlias string

CurrencyColumnAlias represents column names for the currency table

const (
	CurrencyColumnCode CurrencyColumnAlias = "code"
	CurrencyColumnName CurrencyColumnAlias = "name"
)

func (CurrencyColumnAlias) String

func (c CurrencyColumnAlias) String() string

type CurrencyScanner

type CurrencyScanner struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

============================================================================

Currency - справочник валют (не использует BaseEntity)
============================================================================

func (*CurrencyScanner) GetSetter

func (*CurrencyScanner) GetTarget

func (s *CurrencyScanner) GetTarget(col string) func() any

func (*CurrencyScanner) GetValue

func (s *CurrencyScanner) GetValue(f CurrencyColumnAlias) func() any

func (*CurrencyScanner) IntoPb

func (p *CurrencyScanner) IntoPb() *Currency

IntoPb converts plain struct to protobuf message

func (*CurrencyScanner) Relations

Relations returns the relation loaders for the currency table

type CurrencysTable

CurrencysTable represents the currency table with its columns

type EntityID

type EntityID struct {
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

EntityID - базовый type alias для ID сущностей

func (*EntityID) Descriptor deprecated

func (*EntityID) Descriptor() ([]byte, []int)

Deprecated: Use EntityID.ProtoReflect.Descriptor instead.

func (*EntityID) GetValue

func (x *EntityID) GetValue() int64

func (*EntityID) ProtoMessage

func (*EntityID) ProtoMessage()

func (*EntityID) ProtoReflect

func (x *EntityID) ProtoReflect() protoreflect.Message

func (*EntityID) Reset

func (x *EntityID) Reset()

func (*EntityID) String

func (x *EntityID) String() string

type Order

type Order struct {

	// Embedded BaseEntity (id + timestamps)
	Base     *BaseEntity `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	UserId   *EntityID   `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // FK to users.id
	Status   string      `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	Currency string      `protobuf:"bytes,4,opt,name=currency,proto3" json:"currency,omitempty"` // FK to currency.code
	// OneToMany: Order has many OrderItems
	Items []*OrderItem `protobuf:"bytes,10,rep,name=items,proto3" json:"items,omitempty"`
	// BelongsTo: Order belongs to User
	User *User `protobuf:"bytes,11,opt,name=user,proto3" json:"user,omitempty"`
	// BelongsTo: Order belongs to Currency
	Money *Currency `protobuf:"bytes,12,opt,name=money,proto3" json:"money,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Order - заказ (с BaseEntity) ============================================================================

func (*Order) Descriptor deprecated

func (*Order) Descriptor() ([]byte, []int)

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetBase

func (x *Order) GetBase() *BaseEntity

func (*Order) GetCurrency

func (x *Order) GetCurrency() string

func (*Order) GetItems

func (x *Order) GetItems() []*OrderItem

func (*Order) GetMoney added in v0.2.0

func (x *Order) GetMoney() *Currency

func (*Order) GetStatus

func (x *Order) GetStatus() string

func (*Order) GetUser added in v0.2.0

func (x *Order) GetUser() *User

func (*Order) GetUserId

func (x *Order) GetUserId() *EntityID

func (*Order) IntoPlain

func (pb *Order) IntoPlain() *OrderScanner

IntoPlain converts protobuf message to plain struct

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

func (x *Order) ProtoReflect() protoreflect.Message

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type OrderAlias

type OrderAlias string

OrderAlias is the table alias type for the orders table

const OrderAliasName OrderAlias = "orders"

func (OrderAlias) String

func (a OrderAlias) String() string

type OrderColumnAlias

type OrderColumnAlias string

OrderColumnAlias represents column names for the orders table

const (
	OrderColumnId        OrderColumnAlias = "id"
	OrderColumnCreatedAt OrderColumnAlias = "created_at"
	OrderColumnUpdatedAt OrderColumnAlias = "updated_at"
	OrderColumnUserId    OrderColumnAlias = "user_id"
	OrderColumnStatus    OrderColumnAlias = "status"
	OrderColumnCurrency  OrderColumnAlias = "currency"
)

func (OrderColumnAlias) String

func (c OrderColumnAlias) String() string

type OrderItem

type OrderItem struct {
	OrderId   *EntityID `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` // FK to orders.id
	LineNo    int32     `protobuf:"varint,2,opt,name=line_no,json=lineNo,proto3" json:"line_no,omitempty"`
	ProductId *EntityID `protobuf:"bytes,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` // FK to products.id
	Qty       int32     `protobuf:"varint,4,opt,name=qty,proto3" json:"qty,omitempty"`
	UnitPrice float64   `protobuf:"fixed64,5,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
	// BelongsTo: OrderItem belongs to Order
	Order *Order `protobuf:"bytes,10,opt,name=order,proto3" json:"order,omitempty"`
	// BelongsTo: OrderItem belongs to Product
	Product *Product `protobuf:"bytes,11,opt,name=product,proto3" json:"product,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ OrderItem - позиция заказа (без BaseEntity - композитный PK) ============================================================================

func (*OrderItem) Descriptor deprecated

func (*OrderItem) Descriptor() ([]byte, []int)

Deprecated: Use OrderItem.ProtoReflect.Descriptor instead.

func (*OrderItem) GetLineNo

func (x *OrderItem) GetLineNo() int32

func (*OrderItem) GetOrder added in v0.2.0

func (x *OrderItem) GetOrder() *Order

func (*OrderItem) GetOrderId

func (x *OrderItem) GetOrderId() *EntityID

func (*OrderItem) GetProduct added in v0.2.0

func (x *OrderItem) GetProduct() *Product

func (*OrderItem) GetProductId

func (x *OrderItem) GetProductId() *EntityID

func (*OrderItem) GetQty

func (x *OrderItem) GetQty() int32

func (*OrderItem) GetUnitPrice

func (x *OrderItem) GetUnitPrice() float64

func (*OrderItem) IntoPlain

func (pb *OrderItem) IntoPlain() *OrderItemScanner

IntoPlain converts protobuf message to plain struct

func (*OrderItem) ProtoMessage

func (*OrderItem) ProtoMessage()

func (*OrderItem) ProtoReflect

func (x *OrderItem) ProtoReflect() protoreflect.Message

func (*OrderItem) Reset

func (x *OrderItem) Reset()

func (*OrderItem) String

func (x *OrderItem) String() string

type OrderItemAlias

type OrderItemAlias string

OrderItemAlias is the table alias type for the order_items table

const OrderItemAliasName OrderItemAlias = "order_items"

func (OrderItemAlias) String

func (a OrderItemAlias) String() string

type OrderItemColumnAlias

type OrderItemColumnAlias string

OrderItemColumnAlias represents column names for the order_items table

const (
	OrderItemColumnOrderId   OrderItemColumnAlias = "order_id"
	OrderItemColumnLineNo    OrderItemColumnAlias = "line_no"
	OrderItemColumnProductId OrderItemColumnAlias = "product_id"
	OrderItemColumnQty       OrderItemColumnAlias = "qty"
	OrderItemColumnUnitPrice OrderItemColumnAlias = "unit_price"
)

func (OrderItemColumnAlias) String

func (c OrderItemColumnAlias) String() string

type OrderItemScanner

type OrderItemScanner struct {
	OrderId   int64           `json:"orderId"` // origin: type_alias, empath: order_id
	LineNo    int32           `json:"lineNo"`
	ProductId int64           `json:"productId"` // origin: type_alias, empath: product_id
	Qty       int32           `json:"qty"`
	UnitPrice float64         `json:"unitPrice"`
	Order     *OrderScanner   `json:"order"`
	Product   *ProductScanner `json:"product"`
}

============================================================================

OrderItem - позиция заказа (без BaseEntity - композитный PK)
============================================================================

func (*OrderItemScanner) GetSetter

func (*OrderItemScanner) GetTarget

func (s *OrderItemScanner) GetTarget(col string) func() any

func (*OrderItemScanner) GetValue

func (s *OrderItemScanner) GetValue(f OrderItemColumnAlias) func() any

func (*OrderItemScanner) IntoPb

func (p *OrderItemScanner) IntoPb() *OrderItem

IntoPb converts plain struct to protobuf message

func (*OrderItemScanner) Relations

Relations returns the relation loaders for the order_items table

type OrderScanner

type OrderScanner struct {
	Id        int64              `json:"id"` // origin: embed, empath: id
	CreatedAt time.Time          `json:"createdAt"`
	UpdatedAt time.Time          `json:"updatedAt"`
	UserId    int64              `json:"userId"` // origin: type_alias, empath: user_id
	Status    string             `json:"status"`
	Currency  string             `json:"currency"`
	Items     []OrderItemScanner `json:"items"`
	User      *UserScanner       `json:"user"`
	Money     *CurrencyScanner   `json:"money"`
}

============================================================================

Order - заказ (с BaseEntity)
============================================================================

func (*OrderScanner) GetSetter

func (*OrderScanner) GetTarget

func (s *OrderScanner) GetTarget(col string) func() any

func (*OrderScanner) GetValue

func (s *OrderScanner) GetValue(f OrderColumnAlias) func() any

func (*OrderScanner) IntoPb

func (p *OrderScanner) IntoPb() *Order

IntoPb converts plain struct to protobuf message

func (*OrderScanner) Relations

func (s *OrderScanner) Relations() []exec.RelationLoader[*OrderScanner]

Relations returns the relation loaders for the orders table

type Product

type Product struct {

	// Embedded BaseEntity (id + timestamps)
	Base      *BaseEntity `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	Sku       string      `protobuf:"bytes,2,opt,name=sku,proto3" json:"sku,omitempty"`
	Name      string      `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Price     float64     `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"`
	Currency  string      `protobuf:"bytes,5,opt,name=currency,proto3" json:"currency,omitempty"` // FK to currency.code
	StockQty  int32       `protobuf:"varint,6,opt,name=stock_qty,json=stockQty,proto3" json:"stock_qty,omitempty"`
	IsDeleted bool        `protobuf:"varint,7,opt,name=is_deleted,json=isDeleted,proto3" json:"is_deleted,omitempty"`
	// ManyToMany: Product has many Categories
	Categories []*Category `protobuf:"bytes,10,rep,name=categories,proto3" json:"categories,omitempty"`
	// ManyToMany: Product has many Tags
	Tags []*Tag `protobuf:"bytes,11,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Product - товар (с BaseEntity) ============================================================================

func (*Product) Descriptor deprecated

func (*Product) Descriptor() ([]byte, []int)

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetBase

func (x *Product) GetBase() *BaseEntity

func (*Product) GetCategories

func (x *Product) GetCategories() []*Category

func (*Product) GetCurrency

func (x *Product) GetCurrency() string

func (*Product) GetIsDeleted

func (x *Product) GetIsDeleted() bool

func (*Product) GetName

func (x *Product) GetName() string

func (*Product) GetPrice

func (x *Product) GetPrice() float64

func (*Product) GetSku

func (x *Product) GetSku() string

func (*Product) GetStockQty

func (x *Product) GetStockQty() int32

func (*Product) GetTags

func (x *Product) GetTags() []*Tag

func (*Product) IntoPlain

func (pb *Product) IntoPlain() *ProductScanner

IntoPlain converts protobuf message to plain struct

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

func (x *Product) ProtoReflect() protoreflect.Message

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

type ProductAlias

type ProductAlias string

ProductAlias is the table alias type for the products table

const ProductAliasName ProductAlias = "products"

func (ProductAlias) String

func (a ProductAlias) String() string

type ProductColumnAlias

type ProductColumnAlias string

ProductColumnAlias represents column names for the products table

const (
	ProductColumnId        ProductColumnAlias = "id"
	ProductColumnCreatedAt ProductColumnAlias = "created_at"
	ProductColumnUpdatedAt ProductColumnAlias = "updated_at"
	ProductColumnSku       ProductColumnAlias = "sku"
	ProductColumnName      ProductColumnAlias = "name"
	ProductColumnPrice     ProductColumnAlias = "price"
	ProductColumnCurrency  ProductColumnAlias = "currency"
	ProductColumnStockQty  ProductColumnAlias = "stock_qty"
	ProductColumnIsDeleted ProductColumnAlias = "is_deleted"
)

func (ProductColumnAlias) String

func (c ProductColumnAlias) String() string

type ProductScanner

type ProductScanner struct {
	Id         int64             `json:"id"` // origin: embed, empath: id
	CreatedAt  time.Time         `json:"createdAt"`
	UpdatedAt  time.Time         `json:"updatedAt"`
	Sku        string            `json:"sku"`
	Name       string            `json:"name"`
	Price      float64           `json:"price"`
	Currency   string            `json:"currency"`
	StockQty   int32             `json:"stockQty"`
	IsDeleted  bool              `json:"isDeleted"`
	Categories []CategoryScanner `json:"categories"`
	Tags       []TagScanner      `json:"tags"`
}

============================================================================

Product - товар (с BaseEntity)
============================================================================

func (*ProductScanner) GetSetter

func (*ProductScanner) GetTarget

func (s *ProductScanner) GetTarget(col string) func() any

func (*ProductScanner) GetValue

func (s *ProductScanner) GetValue(f ProductColumnAlias) func() any

func (*ProductScanner) IntoPb

func (p *ProductScanner) IntoPb() *Product

IntoPb converts plain struct to protobuf message

func (*ProductScanner) Relations

func (s *ProductScanner) Relations() []exec.RelationLoader[*ProductScanner]

Relations returns the relation loaders for the products table

type Profile added in v0.2.0

type Profile struct {

	// Embedded BaseEntity (id + timestamps)
	Base      *BaseEntity `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	UserId    *EntityID   `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // FK to users.id (unique - one profile per user)
	Bio       string      `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio,omitempty"`
	AvatarUrl string      `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
	// BelongsTo: Profile belongs to User
	User *User `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Profile - профиль пользователя (один к одному с User) ============================================================================

func (*Profile) Descriptor deprecated added in v0.2.0

func (*Profile) Descriptor() ([]byte, []int)

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetAvatarUrl added in v0.2.0

func (x *Profile) GetAvatarUrl() string

func (*Profile) GetBase added in v0.2.0

func (x *Profile) GetBase() *BaseEntity

func (*Profile) GetBio added in v0.2.0

func (x *Profile) GetBio() string

func (*Profile) GetUser added in v0.2.0

func (x *Profile) GetUser() *User

func (*Profile) GetUserId added in v0.2.0

func (x *Profile) GetUserId() *EntityID

func (*Profile) IntoPlain added in v0.2.0

func (pb *Profile) IntoPlain() *ProfileScanner

IntoPlain converts protobuf message to plain struct

func (*Profile) ProtoMessage added in v0.2.0

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect added in v0.2.0

func (x *Profile) ProtoReflect() protoreflect.Message

func (*Profile) Reset added in v0.2.0

func (x *Profile) Reset()

func (*Profile) String added in v0.2.0

func (x *Profile) String() string

type ProfileAlias added in v0.2.0

type ProfileAlias string

ProfileAlias is the table alias type for the profiles table

const ProfileAliasName ProfileAlias = "profiles"

func (ProfileAlias) String added in v0.2.0

func (a ProfileAlias) String() string

type ProfileColumnAlias added in v0.2.0

type ProfileColumnAlias string

ProfileColumnAlias represents column names for the profiles table

const (
	ProfileColumnId        ProfileColumnAlias = "id"
	ProfileColumnCreatedAt ProfileColumnAlias = "created_at"
	ProfileColumnUpdatedAt ProfileColumnAlias = "updated_at"
	ProfileColumnUserId    ProfileColumnAlias = "user_id"
	ProfileColumnBio       ProfileColumnAlias = "bio"
	ProfileColumnAvatarUrl ProfileColumnAlias = "avatar_url"
)

func (ProfileColumnAlias) String added in v0.2.0

func (c ProfileColumnAlias) String() string

type ProfileScanner added in v0.2.0

type ProfileScanner struct {
	Id        int64        `json:"id"` // origin: embed, empath: id
	CreatedAt time.Time    `json:"createdAt"`
	UpdatedAt time.Time    `json:"updatedAt"`
	UserId    int64        `json:"userId"` // origin: type_alias, empath: user_id
	Bio       string       `json:"bio"`
	AvatarUrl string       `json:"avatarUrl"`
	User      *UserScanner `json:"user"`
}

============================================================================

Profile - профиль пользователя (один к одному с User)
============================================================================

func (*ProfileScanner) GetSetter added in v0.2.0

func (*ProfileScanner) GetTarget added in v0.2.0

func (s *ProfileScanner) GetTarget(col string) func() any

func (*ProfileScanner) GetValue added in v0.2.0

func (s *ProfileScanner) GetValue(f ProfileColumnAlias) func() any

func (*ProfileScanner) IntoPb added in v0.2.0

func (p *ProfileScanner) IntoPb() *Profile

IntoPb converts plain struct to protobuf message

func (*ProfileScanner) Relations added in v0.2.0

func (s *ProfileScanner) Relations() []exec.RelationLoader[*ProfileScanner]

Relations returns the relation loaders for the profiles table

type Tag

type Tag struct {

	// Embedded BaseEntity (id + timestamps)
	Base *BaseEntity `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	Name string      `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Slug string      `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Tag - тег для товаров (с BaseEntity) ============================================================================

func (*Tag) Descriptor deprecated

func (*Tag) Descriptor() ([]byte, []int)

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetBase

func (x *Tag) GetBase() *BaseEntity

func (*Tag) GetName

func (x *Tag) GetName() string

func (*Tag) GetSlug

func (x *Tag) GetSlug() string

func (*Tag) IntoPlain

func (pb *Tag) IntoPlain() *TagScanner

IntoPlain converts protobuf message to plain struct

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

func (x *Tag) ProtoReflect() protoreflect.Message

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type TagAlias

type TagAlias string

TagAlias is the table alias type for the tags table

const TagAliasName TagAlias = "tags"

func (TagAlias) String

func (a TagAlias) String() string

type TagColumnAlias

type TagColumnAlias string

TagColumnAlias represents column names for the tags table

const (
	TagColumnId        TagColumnAlias = "id"
	TagColumnCreatedAt TagColumnAlias = "created_at"
	TagColumnUpdatedAt TagColumnAlias = "updated_at"
	TagColumnName      TagColumnAlias = "name"
	TagColumnSlug      TagColumnAlias = "slug"
)

func (TagColumnAlias) String

func (c TagColumnAlias) String() string

type TagScanner

type TagScanner struct {
	Id        int64     `json:"id"` // origin: embed, empath: id
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Name      string    `json:"name"`
	Slug      string    `json:"slug"`
}

============================================================================

Tag - тег для товаров (с BaseEntity)
============================================================================

func (*TagScanner) GetSetter

func (s *TagScanner) GetSetter(f TagColumnAlias) func() set.ValueSetter[TagColumnAlias]

func (*TagScanner) GetTarget

func (s *TagScanner) GetTarget(col string) func() any

func (*TagScanner) GetValue

func (s *TagScanner) GetValue(f TagColumnAlias) func() any

func (*TagScanner) IntoPb

func (p *TagScanner) IntoPb() *Tag

IntoPb converts plain struct to protobuf message

func (*TagScanner) Relations

func (s *TagScanner) Relations() []exec.RelationLoader[*TagScanner]

Relations returns the relation loaders for the tags table

type Timestamps

type Timestamps struct {
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ Timestamps - embedded message для created_at/updated_at ============================================================================

func (*Timestamps) Descriptor deprecated

func (*Timestamps) Descriptor() ([]byte, []int)

Deprecated: Use Timestamps.ProtoReflect.Descriptor instead.

func (*Timestamps) GetCreatedAt

func (x *Timestamps) GetCreatedAt() *timestamppb.Timestamp

func (*Timestamps) GetUpdatedAt

func (x *Timestamps) GetUpdatedAt() *timestamppb.Timestamp

func (*Timestamps) IntoPlain

func (pb *Timestamps) IntoPlain() *TimestampsScanner

IntoPlain converts protobuf message to plain struct

func (*Timestamps) ProtoMessage

func (*Timestamps) ProtoMessage()

func (*Timestamps) ProtoReflect

func (x *Timestamps) ProtoReflect() protoreflect.Message

func (*Timestamps) Reset

func (x *Timestamps) Reset()

func (*Timestamps) String

func (x *Timestamps) String() string

type TimestampsScanner

type TimestampsScanner struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

============================================================================

Timestamps - embedded message для created_at/updated_at
============================================================================

func (*TimestampsScanner) IntoPb

func (p *TimestampsScanner) IntoPb() *Timestamps

IntoPb converts plain struct to protobuf message

type User

type User struct {

	// Embedded BaseEntity (id + timestamps)
	Base     *BaseEntity `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
	Email    string      `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	FullName string      `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"`
	IsActive bool        `protobuf:"varint,4,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
	// OneToMany: User has many Orders
	Orders []*Order `protobuf:"bytes,10,rep,name=orders,proto3" json:"orders,omitempty"`
	// HasOne: User has one Profile
	Profile *Profile `protobuf:"bytes,11,opt,name=profile,proto3" json:"profile,omitempty"`
	// contains filtered or unexported fields
}

============================================================================ User - пользователь системы (с BaseEntity) ============================================================================

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetBase

func (x *User) GetBase() *BaseEntity

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFullName

func (x *User) GetFullName() string

func (*User) GetIsActive

func (x *User) GetIsActive() bool

func (*User) GetOrders

func (x *User) GetOrders() []*Order

func (*User) GetProfile added in v0.2.0

func (x *User) GetProfile() *Profile

func (*User) IntoPlain

func (pb *User) IntoPlain() *UserScanner

IntoPlain converts protobuf message to plain struct

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserAlias

type UserAlias string

UserAlias is the table alias type for the users table

const UserAliasName UserAlias = "users"

func (UserAlias) String

func (a UserAlias) String() string

type UserColumnAlias

type UserColumnAlias string

UserColumnAlias represents column names for the users table

const (
	UserColumnId        UserColumnAlias = "id"
	UserColumnCreatedAt UserColumnAlias = "created_at"
	UserColumnUpdatedAt UserColumnAlias = "updated_at"
	UserColumnEmail     UserColumnAlias = "email"
	UserColumnFullName  UserColumnAlias = "full_name"
	UserColumnIsActive  UserColumnAlias = "is_active"
)

func (UserColumnAlias) String

func (c UserColumnAlias) String() string

type UserScanner

type UserScanner struct {
	Id        int64           `json:"id"` // origin: embed, empath: id
	CreatedAt time.Time       `json:"createdAt"`
	UpdatedAt time.Time       `json:"updatedAt"`
	Email     string          `json:"email"`
	FullName  string          `json:"fullName"`
	IsActive  bool            `json:"isActive"`
	Orders    []OrderScanner  `json:"orders"`
	Profile   *ProfileScanner `json:"profile"`
}

============================================================================

User - пользователь системы (с BaseEntity)
============================================================================

func (*UserScanner) GetSetter

func (s *UserScanner) GetSetter(f UserColumnAlias) func() set.ValueSetter[UserColumnAlias]

func (*UserScanner) GetTarget

func (s *UserScanner) GetTarget(col string) func() any

func (*UserScanner) GetValue

func (s *UserScanner) GetValue(f UserColumnAlias) func() any

func (*UserScanner) IntoPb

func (p *UserScanner) IntoPb() *User

IntoPb converts plain struct to protobuf message

func (*UserScanner) Relations

func (s *UserScanner) Relations() []exec.RelationLoader[*UserScanner]

Relations returns the relation loaders for the users table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL