db

package
v0.0.0-...-5ab2488 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PGReadSingleRow

func PGReadSingleRow[T comparable](scanData *T, call string, data ...any) error

PGReadSingleRow is intended for performing a read operation on a query which strictly returns scalar data.

func PostgresNewPool

func PostgresNewPool() error

PostgresNewPool creates a connection for PostgreSQL. Make sure to close the connection when you no longer require it. To close a connection use CloseConnection method.

Types

type PostgresPoolClient

type PostgresPoolClient struct {
	// contains filtered or unexported fields
}

func Postgres

func Postgres() *PostgresPoolClient

func (*PostgresPoolClient) ExecNonQuery

func (p *PostgresPoolClient) ExecNonQuery(call string, data ...any) error

ExecNonQuery is intended for performing create, update and delete functions.

------------------ IMPORTANT ----------------

DO NOT USE THIS FUNCTION TO PERFORM
READ OPERATIONS. DOING SO WILL
RESULT IN UNEXPECTED RESULTS.

------------------ IMPORTANT ----------------

func (*PostgresPoolClient) FlushPool

func (p *PostgresPoolClient) FlushPool()

func (*PostgresPoolClient) Read

func (p *PostgresPoolClient) Read(call string, data ...any) (pgx.Rows, error)

Read is intended for performing read operations on the database. Use this function only when connection pooling is required.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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