package postgresql

import "github.com/google/trillian/storage/postgresql"

Package postgresql provides a PostgreSQL-based storage layer implementation.

Index

Functions

func BuildPostgresTLSURI

func BuildPostgresTLSURI(uri string) (string, error)

BuildPostgresTLSURI modifies the given PostgreSQL URI to include TLS parameters based on flags. It returns the modified URI and any error encountered.

func GetDatabase

func GetDatabase() (*pgxpool.Pool, error)

GetDatabase returns an instance of PostgreSQL database, or creates one.

TODO(robstradling): Make the dependency of PostgreSQL quota provider from PostgreSQL storage provider explicit.

func NewAdminStorage

func NewAdminStorage(db *pgxpool.Pool) *postgresqlAdminStorage

NewAdminStorage returns a PostgreSQL storage.AdminStorage implementation backed by DB.

func NewLogStorage

func NewLogStorage(db *pgxpool.Pool, mf monitoring.MetricFactory) storage.LogStorage

NewLogStorage creates a storage.LogStorage instance for the specified PostgreSQL URL. It assumes storage.AdminStorage is backed by the same PostgreSQL database as well.

func OpenDB

func OpenDB(dbURL string) (*pgxpool.Pool, error)

OpenDB opens a database connection pool for all PostgreSQL-based storage implementations.

Source Files

admin_storage.go errors.go log_storage.go provider.go queue.go sql.go tree_storage.go

Directories

PathSynopsis
storage/postgresql/testdbpgxPackage testdbpgx creates new PostgreSQL databases for tests.
Version
v1.7.3 (latest)
Published
Mar 30, 2026
Platform
linux/amd64
Imports
35 packages
Last checked
1 hour ago

Tools for package owners.