update

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowSQL added in v0.5.4

func ShowSQL(b bool)

Types

type Builder

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

Builder represent update DML builder

func NewBuilder

func NewBuilder(table string, columns []string, identityIndex int, dialect *info.Dialect) (*Builder, error)

NewBuilder return insert builder

func (*Builder) Build

func (b *Builder) Build(record interface{}, options ...option.Option) string

Build builds update statement

type Service

type Service struct {
	*config.Config
	// contains filtered or unexported fields
}

Service represents updater

func New

func New(ctx context.Context, db *sql.DB, tableName string, options ...option.Option) (*Service, error)

New creates an updater

func (*Service) Exec

func (s *Service) Exec(ctx context.Context, any interface{}, options ...option.Option) (int64, error)

type Updatable added in v0.5.4

type Updatable interface {
	OnUpdate(ctx context.Context) error
}

Updatable interface to be called on updating data

Jump to

Keyboard shortcuts

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