korm

package
v1.2.47 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSchema = errors.New("v is not a schema")

Functions

This section is empty.

Types

type Column

type Column struct {
	Type string
	sql.ColumnType
}

type Config

type Config struct {
	Tag        *Tag
	QRetry     int
	UseNumber  bool
	UsePointer bool
	NoTag      *NoTag
	ConnC      *ConnC
}

type ConnC

type ConnC struct {
	IdleSec   int
	LifeSec   int
	IdleConns int
	OpenConns int
}

type I

type I interface {
	Create(any) error
	Delete(any) error
	Update(any) error
	Query(any) error
	Close() error
}

func Open

func Open() (I, error)

type NoTag

type NoTag struct {
	ColumnSnakeCase bool
	ColumnCamelCase bool
}

type PrimaryKey

type PrimaryKey struct {
	Field  string
	Column string
	// contains filtered or unexported fields
}

type Schema

type Schema interface{ TName() string }

type Stmt

type Stmt struct {
	Tv _Tv // Tv is short for safe_reflectv3.Tv

	FieldColumn map[string]string
	ColumnField map[string]string
	PK          PrimaryKey
	Table       string
	Column      []string
	Values      [][]any

	B kinternal.StringBuilder
	*util.ErrHandle

	RowAffect int64
	// contains filtered or unexported fields
}

func (*Stmt) AfterCreate

func (stmt *Stmt) AfterCreate(result sql.Result) *Stmt

func (Stmt) Close

func (tx Stmt) Close() error

func (Stmt) Create

func (tx Stmt) Create(v any) (err error)

func (Stmt) Delete

func (tx Stmt) Delete(v any) error

func (*Stmt) Execute

func (stmt *Stmt) Execute() *Stmt

func (Stmt) NewInsert

func (tx Stmt) NewInsert(v any) *Stmt

func (*Stmt) Parse

func (stmt *Stmt) Parse(v any) *Stmt

func (Stmt) Query

func (tx Stmt) Query(v any) error

func (Stmt) Update

func (tx Stmt) Update(v any) error

type Table

type Table struct {
	TName        func() string
	WithoutRowID bool
}

type Tag

type Tag struct {
	Key        string
	Column     string
	Type       string
	Size       string
	PrimaryKey string
	Unique     string
	Default    string
	Precision  string
	Scale      string
	NotNULL    string
}

Jump to

Keyboard shortcuts

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