postgres

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_STATEMENT_TIMEOUT = 30 * 1000 // 30 seconds in milliseconds

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase(cfg *ConnectionConfig) (*relational.DB, error)

ConnectToDatabase - Creates a new connection to a PSQL database with the given configuration.

func CreateDatabase

func CreateDatabase(cfg ConnectionConfig) error

CreateDatabase - Creates a new database with the given configuration

func DeleteDatabase

func DeleteDatabase(cfg ConnectionConfig) error

DeleteDatabase - Deletes an existing database with the given configuration

Types

type ConnectionConfig

type ConnectionConfig struct {
	Username         string
	Password         string
	Host             string
	Database         string
	SSL              bool
	Verbose          bool
	StatementTimeout int // Timeout in miliseconds for how long can a statement last before being canceled
}

Jump to

Keyboard shortcuts

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