postgres

package module
v3.36.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

Postgres

postgres is GraphJin's PostgreSQL connection adapter, built on pgx/v5.

Module path:

github.com/aegion-dynamic/graphjin-slim/postgres/v3

It resolves connection settings into a registered pgx connector DSN for sql.Open("pgx", dsn), including search_path, application_name, and TLS material loading. It is a separate module so consumers who only need SQLite build without pgx, and vice versa.

Documentation

Overview

Package postgres provides GraphJin's PostgreSQL connection adapter, built on jackc/pgx/v5.

It is a separate module so that consumers who only need SQLite can build without pgx, and vice versa: the adapter registers nothing globally; the service layer selects it by database type.

Index

Constants

View Source
const DriverPostgres = "pgx"

DriverPostgres is the database/sql driver name (pgx stdlib).

Variables

This section is empty.

Functions

func BuildConn

func BuildConn(o Options) (string, error)

BuildConn resolves the pgx connection configuration into a registered-connector DSN string understood by sql.Open("pgx", ...).

Types

type Options

type Options struct {
	ConnString string
	Host       string
	Port       uint16
	User       string
	Password   string
	DBName     string
	Schema     string
	AppName    string
	OpenDBName bool
	EnableTLS  bool
	ServerName string
	ServerCert string

	// GetFile loads server_cert content when ServerCert is not inline PEM.
	// Optional: nil means "cert must be inline PEM".
	GetFile func(path string) ([]byte, error)
}

Options configures a PostgreSQL connection.

Jump to

Keyboard shortcuts

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