database

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLoginAttempts

func ClearLoginAttempts(t *testing.T, email string)

ClearLoginAttempts removes login attempt records to reset lockout state

func Exec

func Exec(t *testing.T, query string, args ...any)

Exec executes a SQL statement and fails the test on error

func ExecRows added in v0.5.0

func ExecRows(t *testing.T, query string, args ...any) int64

ExecRows is Exec, returning the number of rows it touched. A fixture that updates nothing still succeeds, so a test that has to change a specific row asserts on this rather than trusting the statement ran.

func GetPasswordResetToken

func GetPasswordResetToken(t *testing.T, email string) string

GetPasswordResetToken retrieves the password reset token for a user

func GetVerificationToken

func GetVerificationToken(t *testing.T, email string) string

GetVerificationToken retrieves the email verification token for a user

func QueryRow

func QueryRow(t *testing.T, query string, args ...any) pgx.Row

QueryRow executes a query that returns a single row

func SetUserStatus added in v0.5.0

func SetUserStatus(t *testing.T, email, status string)

SetUserStatus moves an account's status, and asserts it moved a row: a WHERE that matches nothing succeeds, and a test whose subject was never deactivated goes green having proved the opposite of what it says.

Types

This section is empty.

Jump to

Keyboard shortcuts

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