mastodon

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 4 Imported by: 0

README

Mastodon

Mastodon is a Postgres library written in Go. It will allow the user to connect to and interact with a Postgres DB.

Installation

go get -u github.com/bfitzsimmons/mastodon

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.2.0"

Version is the version of the library.

Functions

func GenerateNamedPlaceholders

func GenerateNamedPlaceholders(fields []string) string

GenerateNamedPlaceholders returns named placeholders (:field_name) for use in SQL queries.

func GeneratePlaceholders

func GeneratePlaceholders(num int) string

GeneratePlaceholders returns the field placeholders for use in SQL queries.

func InitializePostgres

func InitializePostgres(config *Config) (*sqlx.DB, error)

InitializePostgres initializes the connections to the Postgres host.

func InitializePostgresWithContext added in v0.2.0

func InitializePostgresWithContext(ctx context.Context, config *Config) (*sqlx.DB, error)

InitializePostgresWithContext initializes the connections to the Postgres host -- with context.

Types

type Config

type Config struct {
	Host               string
	Port               int
	Database           string
	User               string
	Password           string
	SSLMode            string
	MaxConnections     int
	MaxIdleConnections int
	ConnectTimeout     int
}

Config holds the config. data for the Postgres connection.

Jump to

Keyboard shortcuts

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