postgresql

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter(config *Config) (*Adapter, Close, error)

NewAdapter returns a new Adapter instance

Types

type Adapter

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

Adapter represents PostgreSQL adapter

func (*Adapter) GetAllTableNames

func (a *Adapter) GetAllTableNames() ([]string, error)

GetAllTableNames returns all table names in database

func (*Adapter) GetTable

func (a *Adapter) GetTable(tableWithSchemaName string) (*db.Table, error)

GetTable returns table info

type Close

type Close func() error

Close represents function for close database

type Config

type Config struct {
	DBName   string
	User     string
	Password string
	Host     string
	Port     int
	SslMode  string
}

Config represents configuration for PostgreSQL connection

func NewConfig

func NewConfig() *Config

NewConfig returns a new Config instance

func (Config) FormatDSN

func (c Config) FormatDSN() string

FormatDSN formats the given Config into a DSN string which can be passed to the driver.

Jump to

Keyboard shortcuts

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