db

package
v0.0.0-...-1edb5c9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
	URL      string
}

Config is a database configuration

type Db

type Db struct {
	Pool *pgxpool.Pool
	// contains filtered or unexported fields
}

Db contains the database connection pool and its config

func Setup

func Setup(cfg Config) (Db, error)

Setup setups the database

func (*Db) Close

func (db *Db) Close()

Close closes the connection pool

func (*Db) CreateTable

func (db *Db) CreateTable(query string) (err error)

CreateTable executes the query given

Jump to

Keyboard shortcuts

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