db

package
v0.0.0-...-4263410 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPositionBig = errors.New("position argument error")

Pool is the main connection pool for the whole application

Functions

func Close

func Close()

func Initialize

func Initialize(ctx context.Context, schema string) error

Initialize creates connection pool. Close must be called when done.

func IsPostgresError

func IsPostgresError(err error, code PostgresErrorCode) error

Types

type ErrorLineExtract

type ErrorLineExtract struct {
	LineNum   int    // Line number starting with 1
	ColumnNum int    // Column number starting with 1
	Text      string // Text of the line without a new line character.
}

func ExtractErrorLine

func ExtractErrorLine(source string, position int) (ErrorLineExtract, error)

ExtractErrorLine takes source and character position extracts the line number, column number, and the line of text.

The first character is position 1.

type PostgresErrorCode

type PostgresErrorCode string

https://www.postgresql.org/docs/current/errcodes-appendix.html

const (
	UniqueConstraintErrorCode PostgresErrorCode = "23505"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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