examples

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CasbinExamples

func CasbinExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

CasbinExamples :

func DatabaseExamples

func DatabaseExamples(t *testing.T, client *sqlike.Client)

DatabaseExamples :

func DeleteExamples

func DeleteExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

DeleteExamples :

func ExtraExamples

func ExtraExamples(ctx context.Context, t *testing.T, db *sqlike.Database, mg *mongo.Database)

ExtraExamples :

func FindErrorExamples

func FindErrorExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

FindErrorExamples :

func FindExamples

func FindExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

FindExamples :

func IndexExamples

func IndexExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

IndexExamples :

func InsertErrorExamples

func InsertErrorExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

InsertErrorExamples :

func InsertExamples

func InsertExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

InsertExamples :

func JSONExamples

func JSONExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

JSONExamples :

func MigrateErrorExamples

func MigrateErrorExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

MigrateErrorExamples :

func MigrateExamples

func MigrateExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

MigrateExamples :

func PaginationExamples

func PaginationExamples(ctx context.Context, t *testing.T, c *sqlike.Client)

PaginationExamples :

func QueryExamples

func QueryExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

QueryExamples :

func SQLDumpExamples added in v1.1.1

func SQLDumpExamples(ctx context.Context, t *testing.T, client *sqlike.Client)

SQLDumpExamples :

func SpatialExamples

func SpatialExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

SpatialExamples :

func TransactionExamples

func TransactionExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

TransactionExamples :

func UpdateErrorExamples

func UpdateErrorExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

UpdateErrorExamples :

func UpdateExamples

func UpdateExamples(ctx context.Context, t *testing.T, db *sqlike.Database)

UpdateExamples :

Types

type Address

type Address struct {
	Line1 string
	Line2 string `sqlike:",virtual_column"` // this will not work if it's embedded struct
	City  string `sqlike:",virtual_column"` // this will not work if it's embedded struct
	State string `sqlike:",virtual_column"` // this will not work if it's embedded struct
	// Country `sqlike:",inline"`
	Country Country
}

Address :

type Country

type Country struct {
	Name LongStr `sqlike:""`
	Code string  `sqlike:""`
}

Country :

type Enum

type Enum string

Enum :

const (
	Success Enum = "SUCCESS"
	Failed  Enum = "FAILED"
	Unknown Enum = "UNKNOWN"
)

enum :

type LongStr

type LongStr string

LongStr :

type Model

type Model struct {
	CreatedAt time.Time
	UpdatedAt time.Time
}

Model :

type Spatial

type Spatial struct {
	ID             int64 `sqlike:",primary_key,auto_increment"`
	Point          orb.Point
	PtrPoint       *orb.Point
	Point4326      orb.Point `sqlike:"PointWithSRID,srid=4326"`
	LineString     orb.LineString
	LineString2    orb.LineString
	LineString3    orb.LineString
	PtrLineString  *orb.LineString
	LineString4326 orb.LineString `sqlike:"LineStringWithSRID,srid=4326"`
}

Spatial :

type User

type User struct {
	ID        int64
	Name      string
	Age       int
	Status    status `sqlike:",enum=ACTIVE|SUSPEND"`
	CreatedAt time.Time
}

User :

type Users

type Users []User

Users :

func (Users) Len

func (usrs Users) Len() int

Len is part of sort.Interface.

func (Users) Swap

func (usrs Users) Swap(i, j int)

Swap is part of sort.Interface.

Jump to

Keyboard shortcuts

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