Documentation ¶
Index ¶
- func Dialer(keepAlive, timeout time.Duration) *net.Dialer
- func QuerySearchIDs(ctx context.Context, client postgres.Client, table, idCol, whereCond string, ...) ([]string, error)
- type Config
- type PostgresClient
- func (c *PostgresClient) Config() *Config
- func (c *PostgresClient) Delete(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) DeletePK(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) DeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
- func (c *PostgresClient) ForceDeletePK(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) ForceDeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
- func (c *PostgresClient) Insert(ctx context.Context, model ...interface{}) error
- func (c PostgresClient) Ping(ctx context.Context) error
- func (c *PostgresClient) Query(ctx context.Context, result, query interface{}, params ...interface{}) error
- func (c *PostgresClient) QueryOne(ctx context.Context, result, query interface{}, params ...interface{}) error
- func (c PostgresClient) RunInTransaction(ctx context.Context, persist func(client postgres.Client) error) (err error)
- func (c *PostgresClient) Select(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) SelectDeleted(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) SelectDeletedPK(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) SelectDeletedWhere(ctx context.Context, model interface{}, where string, args ...interface{}) error
- func (c *PostgresClient) SelectPK(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) SelectWhere(ctx context.Context, model interface{}, where string, relations []string, ...) error
- func (c *PostgresClient) UndeletePK(ctx context.Context, model ...interface{}) error
- func (c *PostgresClient) UndeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
- func (c *PostgresClient) UpdatePK(ctx context.Context, model interface{}) error
- func (c *PostgresClient) UpdateWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
- type TLSDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `json:"host"` Port string `json:"port"` User string `json:"user"` Password string `json:"password"` Database string `json:"database"` PoolSize int `json:"pool_size"` PoolTimeout time.Duration `json:"pool_timeout"` DialTimeout time.Duration `json:"dial_timeout"` KeepAliveInterval time.Duration `json:"keep_alive_interval"` ApplicationName string `json:"application_name"` SSLMode string `json:"ssl_mode"` TLSCert string `json:"tls_cert"` TLSKey string `json:"tls_key"` TLSCA string `json:"tls_ca"` }
func (*Config) ToPGOptions ¶
type PostgresClient ¶
type PostgresClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *Config) (*PostgresClient, error)
func (*PostgresClient) Config ¶
func (c *PostgresClient) Config() *Config
func (*PostgresClient) Delete ¶
func (c *PostgresClient) Delete(ctx context.Context, model ...interface{}) error
func (*PostgresClient) DeletePK ¶
func (c *PostgresClient) DeletePK(ctx context.Context, model ...interface{}) error
func (*PostgresClient) DeleteWhere ¶
func (c *PostgresClient) DeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
func (*PostgresClient) ForceDeletePK ¶
func (c *PostgresClient) ForceDeletePK(ctx context.Context, model ...interface{}) error
func (*PostgresClient) ForceDeleteWhere ¶
func (c *PostgresClient) ForceDeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
func (*PostgresClient) Insert ¶
func (c *PostgresClient) Insert(ctx context.Context, model ...interface{}) error
func (*PostgresClient) Query ¶
func (c *PostgresClient) Query(ctx context.Context, result, query interface{}, params ...interface{}) error
func (*PostgresClient) QueryOne ¶
func (c *PostgresClient) QueryOne(ctx context.Context, result, query interface{}, params ...interface{}) error
func (PostgresClient) RunInTransaction ¶
func (*PostgresClient) Select ¶
func (c *PostgresClient) Select(ctx context.Context, model ...interface{}) error
func (*PostgresClient) SelectDeleted ¶
func (c *PostgresClient) SelectDeleted(ctx context.Context, model ...interface{}) error
func (*PostgresClient) SelectDeletedPK ¶
func (c *PostgresClient) SelectDeletedPK(ctx context.Context, model ...interface{}) error
func (*PostgresClient) SelectDeletedWhere ¶
func (c *PostgresClient) SelectDeletedWhere(ctx context.Context, model interface{}, where string, args ...interface{}) error
func (*PostgresClient) SelectPK ¶
func (c *PostgresClient) SelectPK(ctx context.Context, model ...interface{}) error
func (*PostgresClient) SelectWhere ¶
func (*PostgresClient) UndeletePK ¶
func (c *PostgresClient) UndeletePK(ctx context.Context, model ...interface{}) error
func (*PostgresClient) UndeleteWhere ¶
func (c *PostgresClient) UndeleteWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
func (*PostgresClient) UpdatePK ¶
func (c *PostgresClient) UpdatePK(ctx context.Context, model interface{}) error
func (*PostgresClient) UpdateWhere ¶
func (c *PostgresClient) UpdateWhere(ctx context.Context, model interface{}, where string, params ...interface{}) error
type TLSDialer ¶
func NewTLSDialer ¶
Click to show internal directories.
Click to hide internal directories.