example

package
v4.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserTableSQL

func CreateUserTableSQL() string

CreateUserTableSQL returns the SQL to create the users table

func ExampleQueries added in v4.1.3

func ExampleQueries()

ExampleQueries demonstrates various query patterns

Types

type User

type User struct {
	ID        int64     `gom:"id,primary_key,auto_increment"`
	Username  string    `gom:"username,size:50,not_null,unique"`
	Email     string    `gom:"email,size:100,not_null,unique"`
	Age       int       `gom:"age"`
	Active    bool      `gom:"active,default:true"`
	Role      string    `gom:"role,size:20,default:'user'"`
	CreatedAt time.Time `gom:"created_at,not_null"`
	UpdatedAt time.Time `gom:"updated_at,not_null"`
}

User represents a user in the system

func (*User) TableName added in v4.1.3

func (u *User) TableName() string

TableName returns the table name for User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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