Categorygithub.com/go-helium/postgres
modulepackage
0.5.1
Repository: https://github.com/go-helium/postgres.git
Documentation: pkg.go.dev

# README

PostgreSQL module (for Helium) provides you connection to PostgreSQL server

Codecov Build Status Report GitHub release Sourcegraph GitHub

Module provides you connection to PostgreSQL server

  • *pg.DB is a database handle representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines

Configuration:

  • yaml example
posgres:
    hostname: string
    username: string
    password: string
    database: string
    debug: bool
    pool_size: int
    options: # optional
      host: string
      sslkey: string
      sslmode: string
      sslcert: string
      sslrootcert: string
  • env example
POSTGRES_HOSTNAME=string
POSTGRES_USERNAME=string
POSTGRES_PASSWORD=string
POSTGRES_DATABASE=string
POSTGRES_DEBUG=bool
POSTGRES_POOL_SIZE=int
POSTGRES_OPTIONS_HOST=string
POSTGRES_OPTIONS_SSLKEY=string
POSTGRES_OPTIONS_SSLMODE=string
POSTGRES_OPTIONS_SSLCERT=string
POSTGRES_OPTIONS_SSLROOTCERT=string

# Functions

NewConnection returns database connection.
NewDefaultConfig returns connection config.

# Constants

ErrEmptyConfig when given empty options.
ErrEmptyLogger when logger not initialized.
ErrPemParse when couldn't parse pem in sslrootcert.
ErrSSLKeyHasWorldPermissions when pk permissions no u=rw (0600) or less.

# Variables

Module is default connection to PostgreSQL.

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author