postgres

package
v0.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package postgres provides the ability for Vela to integrate with Postgres as a SQL backend.

Usage:

import "github.com/go-vela/server/database/postgres"

nolint: dupl // ignore false positive

nolint: dupl // ignore false positive of duplicate code

nolint: dupl // ignore false positive of duplicate code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...ClientOpt) (*client, error)

New returns a Database implementation that integrates with a Postgres instance.

nolint: revive // ignore returning unexported client

func NewTest

func NewTest() (*client, sqlmock.Sqlmock, error)

NewTest returns a Database implementation that integrates with a fake Postgres instance.

This function is intended for running tests only.

nolint: revive // ignore returning unexported client

Types

type ClientOpt

type ClientOpt func(*client) error

ClientOpt represents a configuration option to initialize the database client.

func WithAddress

func WithAddress(address string) ClientOpt

WithAddress sets the Postgres address in the database client.

func WithCompressionLevel

func WithCompressionLevel(level int) ClientOpt

WithCompressionLevel sets the Postgres compression level in the database client.

func WithConnectionIdle

func WithConnectionIdle(idle int) ClientOpt

WithConnectionIdle sets the Postgres maximum idle connections in the database client.

func WithConnectionLife

func WithConnectionLife(duration time.Duration) ClientOpt

WithConnectionLife sets the Postgres connection duration in the database client.

func WithConnectionOpen

func WithConnectionOpen(open int) ClientOpt

WithConnectionOpen sets the Postgres maximum open connections in the database client.

func WithEncryptionKey

func WithEncryptionKey(key string) ClientOpt

WithEncryptionKey sets the Postgres encryption key in the database client.

func WithSkipCreation added in v0.9.0

func WithSkipCreation(skipCreation bool) ClientOpt

WithSkipCreation sets the Postgres skip creation logic in the database client.

Directories

Path Synopsis
Package ddl provides the Postgres data definition language (DDL) for Vela.
Package ddl provides the Postgres data definition language (DDL) for Vela.
Package dml provides the Postgres data manipulation language (DML) for Vela.
Package dml provides the Postgres data manipulation language (DML) for Vela.

Jump to

Keyboard shortcuts

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