Documentation ¶
Index ¶
- Constants
- type Config
- type Plugin
- func (p *Plugin) Boot(conf any, dependencies ...any) plugins.Plugin
- func (p *Plugin) Close() error
- func (p *Plugin) CreateTable(name string) (*Transaction, error)
- func (p *Plugin) IsEnabled() bool
- func (p *Plugin) Name() string
- func (p *Plugin) NewTransaction(name string) *Transaction
- func (p *Plugin) Start() error
- type Transaction
- func (tx *Transaction) Delete(id string) error
- func (tx *Transaction) Find(id string, target any) error
- func (tx *Transaction) FindBy(condition string, params ...any) (*sqlx.Rows, error)
- func (tx *Transaction) QueryRow(qsql string, params ...any) *sqlx.Row
- func (tx *Transaction) Upsert(id string, data any) error
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 (*Plugin) CreateTable ¶
func (p *Plugin) CreateTable(name string) (*Transaction, error)
func (*Plugin) NewTransaction ¶
func (p *Plugin) NewTransaction(name string) *Transaction
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Delete ¶
func (tx *Transaction) Delete(id string) error
Click to show internal directories.
Click to hide internal directories.