postgres_crud

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "postgres-crud"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable bool `env:"POSTGRES_ENABLE" default:"false" yaml:"enable"`
}

type Plugin

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

func New

func New() *Plugin

func (*Plugin) Boot

func (p *Plugin) Boot(conf any, dependencies ...any) plugins.Plugin

func (*Plugin) Close

func (p *Plugin) Close() error

func (*Plugin) CreateTable

func (p *Plugin) CreateTable(name string) (*Transaction, error)

func (*Plugin) IsEnabled

func (p *Plugin) IsEnabled() bool

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) NewTransaction

func (p *Plugin) NewTransaction(name string) *Transaction

func (*Plugin) Start

func (p *Plugin) Start() error

type Transaction

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

func (*Transaction) Delete

func (tx *Transaction) Delete(id string) error

func (*Transaction) Find

func (tx *Transaction) Find(id string, target any) error

func (*Transaction) FindBy added in v1.9.0

func (tx *Transaction) FindBy(condition string, params ...any) (*sqlx.Rows, error)

func (*Transaction) QueryRow added in v1.9.0

func (tx *Transaction) QueryRow(qsql string, params ...any) *sqlx.Row

func (*Transaction) Upsert

func (tx *Transaction) Upsert(id string, data any) error

Jump to

Keyboard shortcuts

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