db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Overview

Package db creates a connection to the database and enables common tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApplication

func AddApplication(connstr string, application string) (string, error)

AddApplication adds an application string to a database connection URL

func Connect

func Connect(ctx context.Context, connstr string, application string) (*pgxpool.Pool, error)

Connect returns a pool of connection to the database, which is conncurrency safe. Uses the pgx interface.

func MigrateDown

func MigrateDown(ctx context.Context, connstr string) error

MigrateDown resets the database back to a blank state. USE WITH CAUTION: THis will result in data loss.

func MigrateUp

func MigrateUp(ctx context.Context, connstr string) error

MigrateUp brings the database to the current schema

Types

This section is empty.

Jump to

Keyboard shortcuts

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