postgrestest

package
v0.0.0-...-54c2f7d Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Overview

Package postgrestest provides CRUD utilities for the postgres database. These utilities allow the caller to modify the database in ways that we wouldn't want to permit in the main code path. To protect against usage in non-test code, all methods should accept a *testing.T struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateACO

func CreateACO(t *testing.T, db *sql.DB, aco models.ACO)

func CreateCCLFBeneficiary

func CreateCCLFBeneficiary(t *testing.T, db *sql.DB, bene *models.CCLFBeneficiary)

func CreateCCLFFile

func CreateCCLFFile(t *testing.T, db *sql.DB, cclfFile *models.CCLFFile)

func CreateJobKeys

func CreateJobKeys(t *testing.T, db *sql.DB, jobKeys ...models.JobKey)

func CreateJobs

func CreateJobs(t *testing.T, db *sql.DB, jobs ...*models.Job)

func DeleteACO

func DeleteACO(t *testing.T, db *sql.DB, acoID uuid.UUID)

DeleteACO also removes data from any foreign key relations (jobs) before deleting the ACO.

func DeleteCCLFFilesByCMSID

func DeleteCCLFFilesByCMSID(t *testing.T, db *sql.DB, cmsID string)

DeleteCCLFFilesByCMSID deletes all CCLFFile associated with a particular ACO represented by cmsID Since (as of 2021-01-13), we have foreign key ties to this table, we'll also delete any relational ties (e.g. CCLFBeneficiary)

func DeleteJobByID

func DeleteJobByID(t *testing.T, db *sql.DB, jobID uint)

func DeleteJobKeysByJobIDs

func DeleteJobKeysByJobIDs(t *testing.T, db *sql.DB, jobIDs ...uint)

func DeleteJobsByACOID

func DeleteJobsByACOID(t *testing.T, db *sql.DB, acoID uuid.UUID)

func DeleteSuppressionFileByID

func DeleteSuppressionFileByID(t *testing.T, db *sql.DB, id uint)

DeleteSuppressionFileByID deletes the suppresion file associated with the given ID. Since (as of 2021-01-13), we have foreign key ties to this table, we'll also delete any relational ties (e.g. Suppressions)

func GetACOByCMSID

func GetACOByCMSID(t *testing.T, db *sql.DB, cmsID string) models.ACO

func GetACOByUUID

func GetACOByUUID(t *testing.T, db *sql.DB, uuid uuid.UUID) models.ACO

func GetALRCount

func GetALRCount(t *testing.T, db *sql.DB, cmsID string) int

func GetCCLFFilesByCMSID

func GetCCLFFilesByCMSID(t *testing.T, db *sql.DB, cmsID string) []models.CCLFFile

func GetCCLFFilesByName

func GetCCLFFilesByName(t *testing.T, db *sql.DB, name string) []models.CCLFFile

func GetJobByID

func GetJobByID(t *testing.T, db *sql.DB, jobID uint) *models.Job

func GetJobKey

func GetJobKey(db *sql.DB, jobID int) ([]models.JobKey, error)

func GetJobsByACOID

func GetJobsByACOID(t *testing.T, db *sql.DB, acoID uuid.UUID) []*models.Job

func GetLatestCCLFFileByCMSIDAndType

func GetLatestCCLFFileByCMSIDAndType(t *testing.T, db *sql.DB, cmsID string, fileType models.CCLFFileType) models.CCLFFile

func GetSuppressionFileByName

func GetSuppressionFileByName(t *testing.T, db *sql.DB, names ...string) []optout.OptOutFile

func GetSuppressionsByFileID

func GetSuppressionsByFileID(t *testing.T, db *sql.DB, fileID uint) []optout.OptOutRecord

func UpdateACO

func UpdateACO(t *testing.T, db *sql.DB, aco models.ACO)

func UpdateJob

func UpdateJob(t *testing.T, db *sql.DB, j models.Job)

Types

This section is empty.

Jump to

Keyboard shortcuts

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