Documentation
¶
Overview ¶
Code generated by cql-gen v0.1.0, DO NOT EDIT.
Index ¶
- type AllTypes
- type Bicycle
- type Brand
- type Child
- type City
- type Color
- type Company
- type CompanyNoTimestamps
- type Country
- type Employee
- type MultiString
- func (s MultiString) GetValue() MultiString
- func (MultiString) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (MultiString) GormDataType() string
- func (s *MultiString) Scan(src interface{}) error
- func (s MultiString) ToSQL(_ *condition.CQLQuery) (string, []any, error)
- func (s MultiString) Value() (driver.Value, error)
- type Parent1
- type Parent2
- type ParentParent
- type Person
- type Phone
- type PhoneNoTimestamps
- type Product
- type ProductNoTimestamps
- type Sale
- type SaleNoTimestamps
- type Seller
- type SellerNoTimestamps
- type ToBeEmbedded
- type ToBeGormEmbedded
- type University
- type WithUnsupportedColumn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllTypes ¶ added in v0.8.0
type AllTypes struct {
model.UUIDModel
ValInt int
ValInt8 int8
ValInt16 int16
ValInt32 int32
ValInt64 int64
ValUint uint
ValUint8 uint8
ValUint16 uint16
ValUint32 uint32
ValUint64 uint64
ValFloat32 float32
ValFloat64 float64
ValBool bool
ValString string
ValTime time.Time
PtrInt *int
PtrInt8 *int8
PtrInt16 *int16
PtrInt32 *int32
PtrInt64 *int64
PtrUint *uint
PtrUint8 *uint8
PtrUint16 *uint16
PtrUint32 *uint32
PtrUint64 *uint64
PtrFloat32 *float32
PtrFloat64 *float64
PtrBool *bool
PtrString *string
PtrTime *time.Time
// database/sql nullable wrappers used directly as fields — these
// exercise the sql.NullInt16 / NullInt32 / NullByte scan pools that the
// sized int/uint value fields (which scan via NullInt64) never touch.
NullInt16 sql.NullInt16
NullInt32 sql.NullInt32
NullByte sql.NullByte
// named scalars (underlying int): stored as their underlying kind, so the
// scanner reads them via NullInt64 and casts back to Color — value and
// nullable-pointer variants.
Favorite Color
PtrColor *Color
}
AllTypes exercises the fast scanner across every supported scalar type — as a value and as a nullable pointer — so a round-trip test can prove each generated scan/assign path materializes the value correctly.
type Bicycle ¶
type Child ¶
type Child struct {
model.UUIDModel
Name string
Number int
Parent1 Parent1
Parent1ID model.UUID
Parent2 Parent2
Parent2ID model.UUID
}
func (Child) GetParent1 ¶
func (Child) GetParent2 ¶
type City ¶
type City struct {
model.UUIDModel
Name string
Country *Country
CountryID model.UUID // Country HasOne City (Country 1 -> 1 City)
}
func (City) GetCountry ¶
type Color ¶ added in v0.8.0
type Color int
Color is a named scalar type: no custom Scan/Value, so gorm stores it as its underlying int. The fast scanner classifies it via its underlying kind and casts the scanned value back to Color, so a plain named scalar takes the fast path (no gorm fallback).
type Company ¶
type Company struct {
model.UUIDModelWithTimestamps
Name string
Sellers *[]Seller // Company HasMany Sellers (Company 0..1 -> 0..* Seller)
}
func (Company) GetSellers ¶
type CompanyNoTimestamps ¶ added in v0.6.0
type CompanyNoTimestamps struct {
model.UUIDModel
Name string
Sellers *[]SellerNoTimestamps // Company HasMany Sellers (Company 0..1 -> 0..* Seller)
}
func (CompanyNoTimestamps) Equal ¶ added in v0.6.0
func (m CompanyNoTimestamps) Equal(other CompanyNoTimestamps) bool
func (CompanyNoTimestamps) GetSellers ¶ added in v0.6.0
func (m CompanyNoTimestamps) GetSellers() ([]SellerNoTimestamps, error)
type Country ¶
type Country struct {
model.UUIDModel
Name string
Capital City // Country HasOne City (Country 1 -> 1 City)
}
func (Country) GetCapital ¶
type Employee ¶
type MultiString ¶
type MultiString []string
func (MultiString) GetValue ¶ added in v0.2.0
func (s MultiString) GetValue() MultiString
func (MultiString) GormDBDataType ¶
func (MultiString) GormDataType ¶
func (MultiString) GormDataType() string
func (*MultiString) Scan ¶
func (s *MultiString) Scan(src interface{}) error
type Parent1 ¶
type Parent1 struct {
model.UUIDModel
Name string
ParentParent ParentParent
ParentParentID model.UUID
}
func (Parent1) GetParentParent ¶
func (m Parent1) GetParentParent() (*ParentParent, error)
type Parent2 ¶
type Parent2 struct {
model.UUIDModel
ParentParent ParentParent
ParentParentID model.UUID
}
func (Parent2) GetParentParent ¶
func (m Parent2) GetParentParent() (*ParentParent, error)
type ParentParent ¶
func (ParentParent) Equal ¶
func (m ParentParent) Equal(other ParentParent) bool
type Phone ¶
type Phone struct {
model.UIntModelWithTimestamps
Name string
// Phone belongsTo Brand (Phone 0..* -> 1 Brand)
Brand Brand
BrandID uint
}
type PhoneNoTimestamps ¶ added in v0.6.0
type PhoneNoTimestamps struct {
model.UIntModel
Name string
// Phone belongsTo Brand (Phone 0..* -> 1 Brand)
Brand Brand
BrandID uint
}
func (PhoneNoTimestamps) Equal ¶ added in v0.6.0
func (m PhoneNoTimestamps) Equal(other PhoneNoTimestamps) bool
func (PhoneNoTimestamps) GetBrand ¶ added in v0.6.0
func (m PhoneNoTimestamps) GetBrand() (*Brand, error)
type Product ¶
type Product struct {
model.UUIDModelWithTimestamps
String string `gorm:"column:string_something_else"`
Int int
IntPointer *int
Float float64
NullFloat sql.NullFloat64
Bool bool
NullBool sql.NullBool
ByteArray []byte
MultiString MultiString
ToBeEmbedded
GormEmbedded ToBeGormEmbedded `gorm:"embedded;embeddedPrefix:gorm_embedded_"`
String2 string
}
type ProductNoTimestamps ¶ added in v0.6.0
type ProductNoTimestamps struct {
model.UUIDModel
String string `gorm:"column:string_something_else"`
Int int
IntPointer *int
Float float64
NullFloat sql.NullFloat64
Bool bool
NullBool sql.NullBool
ByteArray []byte
MultiString MultiString
ToBeEmbedded
GormEmbedded ToBeGormEmbedded `gorm:"embedded;embeddedPrefix:gorm_embedded_"`
String2 string
}
func (ProductNoTimestamps) Equal ¶ added in v0.6.0
func (m ProductNoTimestamps) Equal(other ProductNoTimestamps) bool
type Sale ¶
type Sale struct {
model.UUIDModelWithTimestamps
Code int
Description string
// Sale belongsTo Product (Sale 0..* -> 1 Product)
Product Product
ProductID model.UUID
// Sale belongsTo Seller (Sale 0..* -> 0..1 Seller)
Seller *Seller
SellerID *model.UUID
}
func (Sale) GetProduct ¶
type SaleNoTimestamps ¶ added in v0.6.0
type SaleNoTimestamps struct {
model.UUIDModel
Code int
Description string
// Sale belongsTo Product (Sale 0..* -> 1 Product)
Product ProductNoTimestamps
ProductID model.UUID
// Sale belongsTo Seller (Sale 0..* -> 0..1 Seller)
Seller *SellerNoTimestamps
SellerID *model.UUID
}
func (SaleNoTimestamps) Equal ¶ added in v0.6.0
func (m SaleNoTimestamps) Equal(other SaleNoTimestamps) bool
func (SaleNoTimestamps) GetProduct ¶ added in v0.6.0
func (m SaleNoTimestamps) GetProduct() (*ProductNoTimestamps, error)
func (SaleNoTimestamps) GetSeller ¶ added in v0.6.0
func (m SaleNoTimestamps) GetSeller() (*SellerNoTimestamps, error)
type Seller ¶
type Seller struct {
model.UUIDModel
Name string
Company *Company
CompanyID *model.UUID // Company HasMany Sellers (Company 0..1 -> 0..* Seller)
University *University
UniversityID *model.UUID
}
func (Seller) GetCompany ¶
func (Seller) GetUniversity ¶
func (m Seller) GetUniversity() (*University, error)
type SellerNoTimestamps ¶ added in v0.6.0
type SellerNoTimestamps struct {
model.UUIDModel
Name string
CompanyNoTimestamps *CompanyNoTimestamps
CompanyNoTimestampsID *model.UUID // Company HasMany Sellers (Company 0..1 -> 0..* Seller)
University *University
UniversityID *model.UUID
}
func (SellerNoTimestamps) Equal ¶ added in v0.6.0
func (m SellerNoTimestamps) Equal(other SellerNoTimestamps) bool
func (SellerNoTimestamps) GetCompanyNoTimestamps ¶ added in v0.6.0
func (m SellerNoTimestamps) GetCompanyNoTimestamps() (*CompanyNoTimestamps, error)
func (SellerNoTimestamps) GetUniversity ¶ added in v0.6.0
func (m SellerNoTimestamps) GetUniversity() (*University, error)
type ToBeEmbedded ¶
type ToBeEmbedded struct {
EmbeddedInt int
}
type ToBeGormEmbedded ¶
type ToBeGormEmbedded struct {
Int int
}
type University ¶
func (University) Equal ¶
func (m University) Equal(other University) bool
type WithUnsupportedColumn ¶ added in v0.8.0
type WithUnsupportedColumn struct {
model.UUIDModel
Name string
Tags []string `gorm:"serializer:json"`
}
WithUnsupportedColumn holds a column the fast scanner genuinely can't classify: a []string persisted through gorm's json serializer. There's no static Scan/Value and the value lives in a JSON text column, so no scanner is generated and its queries fall back to gorm's reflective scan — the safety net exercised by TestUnsupportedColumnFallsBackToGorm.