postgres

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 20 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"

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.

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.

Types

type ClientOpt

type ClientOpt func(*client) error

ClientOpt represents a configuration option to initialize the database client for Postgres.

func WithAddress

func WithAddress(address string) ClientOpt

WithAddress sets the address in the database client for Postgres.

func WithCompressionLevel

func WithCompressionLevel(level int) ClientOpt

WithCompressionLevel sets the compression level in the database client for Postgres.

func WithConnectionIdle

func WithConnectionIdle(idle int) ClientOpt

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

func WithConnectionLife

func WithConnectionLife(duration time.Duration) ClientOpt

WithConnectionLife sets the connection duration in the database client for Postgres.

func WithConnectionOpen

func WithConnectionOpen(open int) ClientOpt

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

func WithEncryptionKey

func WithEncryptionKey(key string) ClientOpt

WithEncryptionKey sets the encryption key in the database client for Postgres.

func WithSkipCreation added in v0.9.0

func WithSkipCreation(skipCreation bool) ClientOpt

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

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