package postgresql

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

Package postgresql provides a PostgreSQL-based storage layer implementation.

Index

Functions

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.1 (latest)
Published
Jan 9, 2025
Platform
linux/amd64
Imports
33 packages
Last checked
5 days ago

Tools for package owners.