models

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Code generated by cql-gen v0.1.0, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	model.UIntModelWithTimestamps

	UserID sql.NullInt64
	Number string
}

type Pet

type Pet struct {
	model.UIntModelWithTimestamps

	UserID *model.UIntID
	Name   string
}

type User

type User struct {
	model.UIntModelWithTimestamps

	Name      string
	Age       uint
	Birthday  *time.Time
	Account   Account
	Pets      []*Pet
	NamedPet  *Pet
	CompanyID *int
	Active    bool
}

User mirrors gorm's utils/tests.User for the benchmark suite. The scalar column layout (id, timestamps, name, age, birthday, company_id, active) matches gorm's users table exactly, so per-row scan cost is directly comparable.

The association graph is TRIMMED to the shapes cql-gen currently supports: Account (has-one), Pets (has-many), NamedPet (has-one), CompanyID (belongs-to scalar). Gorm's original User also has polymorphic (Toys, Tools), self-referential (Manager, Team), and many-to-many (Languages, Friends) relationships plus a Company field whose type isn't a cql model — cql-gen can't produce correct conditions/scanners for any of those yet. See cql/cql-gen/TODO.md. The benchmarks themselves don't query the association graph, so the missing fields don't affect BenchmarkFind/Scan/ScanSlice cost; they slightly under-charge BenchmarkCreate/Update's schema-parse work versus gorm's full-User row (a few hundred nanoseconds).

func (User) GetAccount

func (m User) GetAccount() (*Account, error)

Jump to

Keyboard shortcuts

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