sql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package sql provides test suite for integration test with

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSuite

func NewTestSuite(p TestSuiteParams) intTest.TestSuite

NewTestSuite return a new TestSuite for SQL

Types

type TestSuite

type TestSuite struct {
	// contains filtered or unexported fields
}

TestSuite ...

func (*TestSuite) CleanUp

func (s *TestSuite) CleanUp()

CleanUp delete all records and insert data from seed sql file

func (*TestSuite) Create

func (s *TestSuite) Create(ctx context.Context, value interface{}) error

Create creates new record(s)

func (*TestSuite) FindByID

func (s *TestSuite) FindByID(ctx context.Context, entity interface{}, id uint) error

FindByID retrieves the entity from database by primary key ID

func (*TestSuite) StartUp

func (s *TestSuite) StartUp() interface{}

StartUp runs database migration up scripts

type TestSuiteParams

type TestSuiteParams struct {
	DbConfigFilePath        string
	DbName                  string
	DbMigrationSourceFolder string
	DbDataSeedFilePath      string
}

TestSuiteParams ...

Jump to

Keyboard shortcuts

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