postgresql

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

Types

type Client

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

Client struct holding connection string

func (*Client) DB added in v0.1.1

func (c *Client) DB() *sql.DB

DB returns a copy to an sql.Open()'ed database connection. Callers must return their database resources. Use of QueryRow() or Exec() is encouraged. Query() must have their rows.Close()'ed.

type ClientCertificateConfig added in v1.7.3

type ClientCertificateConfig struct {
	CertificatePath string
	KeyPath         string
}

type Config

type Config struct {
	Host              string
	Port              int
	Username          string
	Password          string
	DatabaseUsername  string
	Superuser         bool
	SSLMode           string
	ApplicationName   string
	Timeout           int
	ConnectTimeoutSec int
	MaxConns          int
	ExpectedVersion   semver.Version
	SSLClientCert     *ClientCertificateConfig
	SSLRootCertPath   string
}

Config - provider config

func (*Config) NewClient

func (c *Config) NewClient(database string) (*Client, error)

NewClient returns client config for the specified database.

type QueryAble added in v1.7.3

type QueryAble interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
}

QueryAble is a DB connection (sql.DB/Tx)

Jump to

Keyboard shortcuts

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