common

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 0 Imported by: 0

README

common

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDataType

type ColumnDataType string

type DatabaseType

type DatabaseType string

type GlobalThisReader

type GlobalThisReader interface {
	Input() any
	Env() map[string]any
	Metas() map[string]any
	Session() map[string]any
	RequestHeaders() map[string]any

	Output() any
	ResponseHeaders() map[string]any
}

type PersistenceContext

type PersistenceContext interface {
	GetRepository(entity string) (Repository, error)
	GetAllQueryCount() int64
	CloseAllTxn(error) error
}

type PreparedQuery

type PreparedQuery struct {
	Query     string    `json:"query"`
	Bind      []any     `json:"bind"`
	QueryType QueryType `json:"queryType"`

	CheckPoint      []*PreparedQuery `json:"checkPoint"`
	DatabaseUpdater []*PreparedQuery `json:"databaseUpdater"`
	ResultEnricher  []*PreparedQuery `json:"resultEnricher"`
}

type QueryResult

type QueryResult struct {
	Row          map[string]any
	Rows         []map[string]any
	RowsAffected int64
	LastInsertId int64
	Total        int64
}

type QueryType

type QueryType string

type Repository

type Repository interface {
	BindNamed(query string, arg any) (string, []any, error)
	Find(query string, args ...any) (map[string]any, error)
	FindAll(query string, args ...any) ([]map[string]any, error)
	Insert(query string, args ...any) (int64, error)
	InsertBatch(query string, args ...any) (int64, error)
	// InsertNamedBatch
	// Deprecated
	InsertNamedBatch(query string, args []any) (int64, error)
	Update(query string, args ...any) (int64, error)
	Delete(query string, args ...any) (int64, error)

	Begin() error
	Commit() error
	Rollback() error

	Exec(query string, args ...any) error

	DriverName() string

	QueryTotal() int64
	SetTraceId(traceId string)
}

type ScriptRunner

type ScriptRunner interface {
	RunScript(globalThis map[string]any, pCtx PersistenceContext, sourceCode string) (any, error)
}

type TableType

type TableType string

Jump to

Keyboard shortcuts

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