adapters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	NewInsert() Insert
	NewUpdate() Update
	NewDelete() Delete
	NewSelect() Select
	NewFind() Find
	GetInstance() any
}

type Delete

type Delete interface {
	Model(model any) Delete
	Condition(name string, value any) Delete
	Exec(ctx context.Context) error
}

type Find

type Find interface {
	Model(model any) Find
	Condition(name string, value any) Find
	Exec(ctx context.Context) error
}

type Insert

type Insert interface {
	Model(model any) Insert
	Exec(ctx context.Context) (*InsertResult, error)
}

type InsertResult

type InsertResult struct {
	Result any `json:"result"`
}

type Select

type Select interface {
	Model(model any) Select
	Condition(name string, value any) Select
	Count(ctx context.Context) (int64, error)
	OrderBy(name string, order string) Select
	Exec(ctx context.Context) error

	// GreaterThan Operator where the value of the field is greater than (>)
	GreaterThan(name string, value any) Select
	// GreaterThanEqual Operator where the value of the field is greater than or equal (>=)
	GreaterThanEqual(name string, value any) Select
	// LessThan Operator where the value of the field is less than (<)
	LessThan(name string, value any) Select
	// LessThanEqual Operator where the value of the field is less than or equal (<=)
	LessThanEqual(name string, value any) Select
	// In Operator where the value of the field equals any value the specified list
	In(name string, value any) Select
	// NotEqual Operator where the value of the field is not equal
	NotEqual(name string, value any) Select
}

type Update

type Update interface {
	Model(model any) Update
	Condition(name string, value any) Update
	Set(name string, value any) Update
	Exec(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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