Documentation ¶
Index ¶
- type Client
- type ClientOptions
- func (o *ClientOptions) SetDatabase(database string) *ClientOptions
- func (o *ClientOptions) SetHost(host string) *ClientOptions
- func (o *ClientOptions) SetPassword(password string) *ClientOptions
- func (o *ClientOptions) SetPort(port int) *ClientOptions
- func (o *ClientOptions) SetUsername(username string) *ClientOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Connect to Postgres Connect() error // Disconnect from Postgres Disconnect() error Migrate() error Execute(query string, args ...any) error Select(query string, args ...any) *sql.Row }
func NewClient ¶
func NewClient(options *ClientOptions) Client
type ClientOptions ¶
type ClientOptions struct { Host string Port int Databse string Username string Password string SslMode string }
func NewClientOptions ¶
func NewClientOptions() *ClientOptions
func (*ClientOptions) SetDatabase ¶
func (o *ClientOptions) SetDatabase(database string) *ClientOptions
func (*ClientOptions) SetHost ¶
func (o *ClientOptions) SetHost(host string) *ClientOptions
func (*ClientOptions) SetPassword ¶
func (o *ClientOptions) SetPassword(password string) *ClientOptions
func (*ClientOptions) SetPort ¶
func (o *ClientOptions) SetPort(port int) *ClientOptions
func (*ClientOptions) SetUsername ¶
func (o *ClientOptions) SetUsername(username string) *ClientOptions
Click to show internal directories.
Click to hide internal directories.