aggregates

package
v0.0.0-...-7a397de Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WrapErr     = func(err *Error) error { return err }
	Logger      func(format string, args ...any)
	ShouldRetry func(driver string, err error) bool
)
View Source
var SQLite3JournalMode = "WAL"

SQLite3JournalMode controls the journal_mode pragma for all new connections. Since it is read without a mutex, it must be changed to the value you want before any Open calls.

Functions

func DeleteAll

func DeleteAll(ctx context.Context, db *DB) (int64, error)

Types

type COUNT_SUMAmount_AVGPrice_Row

type COUNT_SUMAmount_AVGPrice_Row struct {
	COUNT     int64
	SUMAmount *int64
	AVGPrice  *float64
}

type CustomerId_AVGPrice_Row

type CustomerId_AVGPrice_Row struct {
	CustomerId int64
	AVGPrice   *float64
}

type CustomerId_COUNTId_Row

type CustomerId_COUNTId_Row struct {
	CustomerId int64
	COUNTId    int64
}

type CustomerId_MINAmount_MAXAmount_Row

type CustomerId_MINAmount_MAXAmount_Row struct {
	CustomerId int64
	MINAmount  *int64
	MAXAmount  *int64
}

type CustomerId_SUMAmount_COUNT_Row

type CustomerId_SUMAmount_COUNT_Row struct {
	CustomerId int64
	SUMAmount  *int64
	COUNT      int64
}

type DB

type DB struct {
	*sql.DB

	Hooks struct {
		Now func() time.Time
	}
	// contains filtered or unexported fields
}

func Open

func Open(driver, source string) (db *DB, err error)

func (*DB) Close

func (obj *DB) Close() (err error)

func (*DB) Open

func (obj *DB) Open(ctx context.Context) (*Tx, error)

type DBMethods

type DBMethods interface {
	Methods

	Schema() []string
	DropSchema() []string

	Rebind(sql string) string
}

type Error

type Error struct {
	Err         error
	Code        ErrorCode
	Driver      string
	Constraint  string
	QuerySuffix string
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode int
const (
	ErrorCode_Unknown ErrorCode = iota
	ErrorCode_UnsupportedDriver
	ErrorCode_NoRows
	ErrorCode_TxDone
	ErrorCode_TooManyRows
	ErrorCode_ConstraintViolation
	ErrorCode_EmptyUpdate
)

type Methods

type Methods interface {
	All_Order_CustomerId_Avg_Order_Price_GroupBy_CustomerId(ctx context.Context) (
		rows []*CustomerId_AVGPrice_Row, err error)

	All_Order_CustomerId_Count_Order_Id_GroupBy_CustomerId(ctx context.Context) (
		rows []*CustomerId_COUNTId_Row, err error)

	All_Order_CustomerId_Min_Order_Amount_Max_Order_Amount_GroupBy_CustomerId(ctx context.Context) (
		rows []*CustomerId_MINAmount_MAXAmount_Row, err error)

	All_Order_CustomerId_Sum_Order_Amount_Count_GroupBy_CustomerId(ctx context.Context) (
		rows []*CustomerId_SUMAmount_COUNT_Row, err error)

	Find_Count_Sum_Order_Amount_Avg_Order_Price(ctx context.Context) (
		row *COUNT_SUMAmount_AVGPrice_Row, err error)

	Find_Sum_Order_Amount(ctx context.Context) (
		row *SUMAmount_Row, err error)
}

type Order

type Order struct {
	Id         int64
	CustomerId int64
	Amount     int64
	Price      float64
}

type Order_Amount_Field

type Order_Amount_Field struct {
	// contains filtered or unexported fields
}

func Order_Amount

func Order_Amount(v int64) Order_Amount_Field

type Order_CustomerId_Field

type Order_CustomerId_Field struct {
	// contains filtered or unexported fields
}

func Order_CustomerId

func Order_CustomerId(v int64) Order_CustomerId_Field

type Order_Id_Field

type Order_Id_Field struct {
	// contains filtered or unexported fields
}

func Order_Id

func Order_Id(v int64) Order_Id_Field

type Order_Price_Field

type Order_Price_Field struct {
	// contains filtered or unexported fields
}

func Order_Price

func Order_Price(v float64) Order_Price_Field

type Order_Update_Fields

type Order_Update_Fields struct {
}

type SUMAmount_Row

type SUMAmount_Row struct {
	SUMAmount *int64
}

type Tx

type Tx struct {
	Tx *sql.Tx
	// contains filtered or unexported fields
}

func (*Tx) ExecContext

func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*Tx) QueryContext

func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)

func (*Tx) QueryRowContext

func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row

type TxMethods

type TxMethods interface {
	Methods

	Rebind(s string) string
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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