postgres

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 6 Imported by: 0

README

appsap-postgres

Getting Started

Postgres lib for appsap-core framework

Installation

Run the following command to install the package:

go get github.com/mortired/appsap-postgres

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
}

Config structure for PostgreSQL configuration Allows infrastructure to not depend on application packages

func ProvidePostgresConfig

func ProvidePostgresConfig(logger *logging.Logger) Config

ProvidePostgresConfig creates PostgreSQL configuration from environment variables

type DB

type DB struct {
	*sql.DB
}

DB manages PostgreSQL connection

func New

func New(cfg Config) (*DB, error)

New creates a new PostgreSQL connection

func (*DB) Close

func (db *DB) Close() error

Close closes database connection

Jump to

Keyboard shortcuts

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