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 ¶
- func CreateACO(t *testing.T, db *sql.DB, aco models.ACO)
- func CreateCCLFBeneficiary(t *testing.T, db *sql.DB, bene *models.CCLFBeneficiary)
- func CreateCCLFFile(t *testing.T, db *sql.DB, cclfFile *models.CCLFFile)
- func CreateJobKeys(t *testing.T, db *sql.DB, jobKeys ...models.JobKey)
- func CreateJobs(t *testing.T, db *sql.DB, jobs ...*models.Job)
- func DeleteACO(t *testing.T, db *sql.DB, acoID uuid.UUID)
- func DeleteCCLFFilesByCMSID(t *testing.T, db *sql.DB, cmsID string)
- func DeleteJobByID(t *testing.T, db *sql.DB, jobID uint)
- func DeleteJobKeysByJobIDs(t *testing.T, db *sql.DB, jobIDs ...uint)
- func DeleteJobsByACOID(t *testing.T, db *sql.DB, acoID uuid.UUID)
- func DeleteSuppressionFileByID(t *testing.T, db *sql.DB, id uint)
- func GetACOByCMSID(t *testing.T, db *sql.DB, cmsID string) models.ACO
- func GetACOByUUID(t *testing.T, db *sql.DB, uuid uuid.UUID) models.ACO
- func GetALRCount(t *testing.T, db *sql.DB, cmsID string) int
- func GetCCLFFilesByCMSID(t *testing.T, db *sql.DB, cmsID string) []models.CCLFFile
- func GetCCLFFilesByName(t *testing.T, db *sql.DB, name string) []models.CCLFFile
- func GetJobByID(t *testing.T, db *sql.DB, jobID uint) *models.Job
- func GetJobKey(db *sql.DB, jobID int) ([]models.JobKey, error)
- func GetJobsByACOID(t *testing.T, db *sql.DB, acoID uuid.UUID) []*models.Job
- func GetLatestCCLFFileByCMSIDAndType(t *testing.T, db *sql.DB, cmsID string, fileType models.CCLFFileType) models.CCLFFile
- func GetSuppressionFileByName(t *testing.T, db *sql.DB, names ...string) []optout.OptOutFile
- func GetSuppressionsByFileID(t *testing.T, db *sql.DB, fileID uint) []optout.OptOutRecord
- func UpdateACO(t *testing.T, db *sql.DB, aco models.ACO)
- func UpdateJob(t *testing.T, db *sql.DB, j models.Job)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCCLFBeneficiary ¶
func DeleteACO ¶
DeleteACO also removes data from any foreign key relations (jobs) before deleting the ACO.
func DeleteCCLFFilesByCMSID ¶
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 DeleteSuppressionFileByID ¶
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 GetCCLFFilesByCMSID ¶
func GetCCLFFilesByName ¶
func GetSuppressionsByFileID ¶
Types ¶
This section is empty.