examples

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvancedQueryExample

func AdvancedQueryExample(db interface{})

AdvancedQueryExample 高级查询示例

func BatchUpsertExample

func BatchUpsertExample(db interface{})

BatchUpsertExample 批量Upsert - 推荐写法

func ComparisonExample

func ComparisonExample()

对比:复杂写法 vs 简单写法

func CreateUserBadExample

func CreateUserBadExample(db interface{})

CreateUserBadExample 创建用户 - 不推荐写法

func CreateUserExample

func CreateUserExample(db interface{})

CreateUserExample 创建用户 - 推荐写法

func DeleteUserExample

func DeleteUserExample(db interface{})

DeleteUserExample 删除用户 - 推荐写法

func ExampleSimpleCRUD

func ExampleSimpleCRUD()

简单CRUD使用示例 - 真正的简单易用!

func PerformanceExample

func PerformanceExample(db interface{})

PerformanceExample 性能优化示例

func QueryUserExample

func QueryUserExample(db interface{})

QueryUserExample 查询用户 - 推荐写法

func RealWorldExample

func RealWorldExample()

真实项目使用示例

func TransactionExample

func TransactionExample(db interface{})

TransactionExample 事务处理 - 推荐写法

func UpdateUserExample

func UpdateUserExample(db interface{})

UpdateUserExample 更新用户 - 推荐写法

func UsageGuide

func UsageGuide()

使用指南

Types

type UserExample

type UserExample struct {
	ID        int64      `json:"id"`
	Name      string     `json:"name"`
	Email     string     `json:"email"`
	Age       int        `json:"age"`
	Status    string     `json:"status"`
	Version   int64      `json:"version"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
}

UserExample 用户示例

Jump to

Keyboard shortcuts

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