Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package postgres is the PostgreSQL dialect of dbcleaner. Importing it registers the dialect for postgres:// and postgresql:// URLs, and the pgx driver it opens them with:

import _ "github.com/mokevnin/dbcleaner/postgres"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dialect

func Dialect() dbcleaner.Leaser

Dialect is the PostgreSQL dialect, for dbcleaner.WithDialect when the URL is a key=value DSN. It is also a dbcleaner.Leaser.

func ScratchDatabase

func ScratchDatabase(t testing.TB, adminURL string) string

ScratchDatabase creates an empty, uniquely named database on the server behind adminURL and returns its URL; the database is dropped when the test ends. It is for code that needs a database with no schema at all (migrations on a fresh instance), which a pre-migrated one cannot give. The role in adminURL must be able to create databases.

Types

This section is empty.

Jump to

Keyboard shortcuts

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