Documentation
¶
Index ¶
- func CSVToMap(reader io.Reader) []map[string]string
- func ReadContents(path string) (string, error)
- func Replace(sql string, replacement Replacement) string
- func RunExpectationMinusQuery(ctx context.Context, client *bigquery.Client, query string) error
- func RunQueryMinusExpectation(ctx context.Context, client *bigquery.Client, query string) error
- func RunTests(mode string, tests []Test) error
- func SaveSQL(path string, sql string) error
- type Mock
- type Output
- type Replacement
- type SQLMock
- type SQLTestQuery
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSVToMap ¶
Utility Function, converts a CSV file into a List of dictionaries. Each row is converted into a dictionary where the keys are columns.
func ReadContents ¶
func Replace ¶
func Replace(sql string, replacement Replacement) string
Given a SQL query and a replacement Struct, it applies the recplament on the SQL and returns a new SQL query. References to a Table are replaced
Types ¶
type Replacement ¶
type SQLTestQuery ¶
type SQLTestQuery struct {
ExpectedMinusQuery string
QueryMinusExpected string
QueryWithMockedData string
}
func GenerateTestSQL ¶
func GenerateTestSQL(t Test) (SQLTestQuery, error)
Given a Test it generates the SQL code that mocks data, run the needed logic and asserts the output data
Click to show internal directories.
Click to hide internal directories.