dbsql

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptTable

func AdaptTable(dbsql DBsql, name string, col any) error

AdaptTable adapt table to new struct

func Batch

func Batch(dbsql DBsql, batch string) error

func BatchSelect

func BatchSelect(dbsql DBsql, batch string) ([][]interface{}, error)

BatchSelect batch SQL query in table with values returned

func BatchSelectFct

func BatchSelectFct(dbsql DBsql, batch *common.Query, fct common.ResultFunction) error

BatchSelectFct batch SQL query in table with fct called

func CreateTable

func CreateTable(dbsql DBsql, name string, col any) error

func CreateTableByColumns

func CreateTableByColumns(baAvailable bool, columns []*common.Column) string

func CreateTableByStruct

func CreateTableByStruct(baAvailable bool, columns any) (string, error)

func CreateWhere

func CreateWhere(valueIndex int, updateInfo *common.Entries, whereFields []int) string

func Delete

func Delete(dbsql DBsql, name string, updateInfo *common.Entries) (rowsAffected int64, err error)

func DeleteTable

func DeleteTable(dbsql DBsql, name string) error

func GenerateDelete

func GenerateDelete(indexNeeded bool, name string, valueIndex int, deleteInfo *common.Entries) (string, []any)

func GenerateUpdate

func GenerateUpdate(indexNeeded bool, name string, updateInfo *common.Entries) (string, []int)

func Insert

func Insert(dbsql DBsql, name string, insert *common.Entries) ([][]any, error)

func SqlDataType

func SqlDataType(baAvailable bool, columns any, ignoreList []string) (string, error)

func Update

func Update(dbsql DBsql, name string, updateInfo *common.Entries) (running [][]any, rowsAffected int64, err error)

Types

type DBsql

type DBsql interface {
	ID() common.RegDbID
	Open() (any, error)
	StartTransaction() (*sql.Tx, context.Context, error)
	EndTransaction(bool) error
	Close()
	Reference() (string, string)
	IndexNeeded() bool
	ByteArrayAvailable() bool
	IsTransaction() bool
}

Jump to

Keyboard shortcuts

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