database

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command = string

type ICursor

type ICursor interface {
	Scan(...Parameter) error
}

type ISqlDatabase

type ISqlDatabase interface {
	Initialize() error
	GetName() string
	GetSchema() ISqlSchema
	RunScript(string, string) error
	Query(Iterator, Command, ...Parameter) error
	QuerySingle(Iterator, Command, ...Parameter) error
	Execute(Command, ...Parameter) (int64, error)
	ExecuteAtomic(ISqlTransaction, Command, ...Parameter) (int64, error)
	ExecuteBatch(Command, int64, ...Parameter) (int64, error)
	InsertSingle(Command, ...Parameter) error
	InsertSingleAtomic(ISqlTransaction, Command, ...Parameter) error
	UpdateSingle(Command, ...Parameter) error
	UpdateSingleAtomic(ISqlTransaction, Command, ...Parameter) error
	DeleteSingle(Command, ...Parameter) error
	DeleteSingleAtomic(ISqlTransaction, Command, ...Parameter) error
	InsertAll(Command, int64, ...Parameter) error
	Count(Command, ...Parameter) (int, error)
	WithTransaction(SqlTransactionHandler) error
}

type ISqlSchema

type ISqlSchema interface {
	GetTables() []string
	GetColumns(table string) []string
	GetTriggers() []string
	HasTable(table string) bool
	HasHistoryTable(table string) bool
	HasColumn(table, column string) bool
	HasTrigger(trigger string) bool
}

type ISqlTransaction

type ISqlTransaction interface {
	OnCommit(func())
}

type Iterator

type Iterator func(ICursor) error

type Parameter

type Parameter = interface{}

type SqlTransactionHandler

type SqlTransactionHandler func(transaction ISqlTransaction) error

Jump to

Keyboard shortcuts

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