fixtures

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Created at 2026-06-28

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	City   string
	Street string
	Zip    string
}

Address — структура для тестирования префикса на именованных полях-структурах

type AutoEmbedded

type AutoEmbedded struct {
	CreatedAt string `qqm:"col=created_at;auto"`
	UpdatedAt string `qqm:"col=updated_at;readonly"`
}

AutoEmbedded — структура с auto и readonly полями

type DeepNested

type DeepNested struct {
	EmbeddedFields `qqm:"prefix=deep_"`
	Extra          int `qqm:"col=extra"`
}

DeepNested — структура для тестов глубокой вложенности

type EmbeddedFields

type EmbeddedFields struct {
	Name  string `qqm:"col=name"`
	Email string `qqm:"col=email"`
}

EmbeddedFields — структура с полями для тестов prefix

type EmbeddedPK

type EmbeddedPK struct {
	ID int64 `qqm:"pk;col=id"`
}

EmbeddedPK — структура с PK для тестов anonymous struct

type FullRoomMapping

type FullRoomMapping struct {
	RoomMapping
	Author string `qqm:"col=author_name"`
}

FullRoomMapping — полная связь с автором

type MappingRoomID

type MappingRoomID struct {
	ID int64 `qqm:"pk"`
}

MappingRoomID — ключ комнаты для составного ключа (без auto)

type OrgUser

type OrgUser struct {
	OrgID  int64 `qqm:"pk"`
	UserID int64 `qqm:"pk"`
	Name   string
	Email  string
}

OrgUser — структура с составным ключом

func (*OrgUser) SQLName

func (o *OrgUser) SQLName() string

type PKWithAuto

type PKWithAuto struct {
	ID int64 `qqm:"pk;auto"`
}

PKWithAuto — структура с auto PK

type PersonWithAddress

type PersonWithAddress struct {
	ID          int64 `qqm:"pk"`
	Name        string
	HomeAddress Address `qqm:"prefix=home_"`
	WorkAddress Address `qqm:"prefix=work_"`
}

PersonWithAddress — структура с двумя именованными полями-структурами с префиксами

type RoomID

type RoomID struct {
	ID int64 `qqm:"pk;auto"`
}

RoomID — простой ключ с автогенерацией

type RoomMapping

type RoomMapping struct {
	MappingRoomID `qqm:"prefix=room_;ref=rooms.id"`
	TeacherKey    `qqm:"prefix=teacher_"`
	From          int64 `qqm:"col=time_from"`
	To            int64 `qqm:"col=time_to"`
	CreatedAt     int64 `qqm:"auto"`
}

RoomMapping — таблица связей комнат и преподавателей

type Rooms

type Rooms struct {
	RoomID
	Name      string
	Square    float64
	CreatedAt int64 `qqm:"auto"`
}

Rooms — таблица комнат

type RowWithAutoEmbed

type RowWithAutoEmbed struct {
	ID int64 `qqm:"pk"`
	AutoEmbedded
	Value string `qqm:"col=value"`
}

RowWithAutoEmbed — структура с embedded auto/readonly полями

type RowWithDeepEmbed

type RowWithDeepEmbed struct {
	DeepNested `qqm:"prefix=nested_"`
	TopField   string `qqm:"col=top_field"`
}

RowWithDeepEmbed — структура с глубокой вложенностью

type RowWithEmbeddedPK

type RowWithEmbeddedPK struct {
	EmbeddedPK
	EmbeddedFields `qqm:"prefix=usr_"`
	Status         string `qqm:"col=status"`
}

RowWithEmbeddedPK — структура с embedded PK и prefix

type RowWithPKAuto

type RowWithPKAuto struct {
	PKWithAuto
	Name string `qqm:"col=name"`
}

RowWithPKAuto — структура с embedded auto PK

type SomeID

type SomeID int64

SomeID — тип для SomeTable

type SomeTable

type SomeTable struct {
	SomeID  `qqm:"pk"`
	FieldRW string
	FieldRO time.Time `qqm:"auto"`
}

SomeTable — структура с anonymous non-struct PK и auto полем

type TeacherID

type TeacherID int64

TeacherID — тип для составного ключа

type TeacherKey

type TeacherKey struct {
	Key TeacherID `qqm:"pk;col=ID"`
}

TeacherKey — ключ преподавателя

type User

type User struct {
	ID    int64 `qqm:"pk"`
	Name  string
	Email string
}

User — структура с простым ключом

type UserWithAge

type UserWithAge struct {
	ID    int64 `qqm:"pk"`
	Name  string
	Email string
	Age   int
}

UserWithAge — структура с простым ключом и возрастом

Jump to

Keyboard shortcuts

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