examples

package
v2.0.0-...-d0150a3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvanceQueryExamples

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

AdvanceQueryExamples :

func CasbinExamples

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

CasbinExamples :

func DatabaseExamples

func DatabaseExamples(ctx context.Context, 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 JoinExamples

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

JoinExamples :

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 SQLDumpExamples

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 CustomValue

type CustomValue struct {
}

func (CustomValue) ColumnDataType

func (c CustomValue) ColumnDataType(ctx context.Context) *sql.Column

ColumnDataType :

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 `sqlike:",auto_increment"`
	Name      string
	Age       int
	Status    userStatus `sqlike:",enum=ACTIVE|SUSPEND"`
	CreatedAt time.Time  `sqlike:",default=CURRENT_TIMESTAMP"`
}

User :

type UserAddress

type UserAddress struct {
	ID     int64 `sqlike:",auto_increment"`
	UserID int64 `sqlike:",foreign_key=User:ID"`
}

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