package
0.0.0-20230101183712-202847b4b89b
Repository: https://github.com/corestoreio/csfw.git
Documentation: pkg.go.dev

# Functions

CheckLastInsertID returns a function which accepts the return result from Exec*() and returns itself the last_insert_id or emits an error.
Close for usage in conjunction with defer.
FatalIfError fails the tests if an unexpected error occurred.
LoadCSV loads a csv file for mocked database testing.
MockClose for usage in conjunction with defer.
MockDB creates a mocked database connection.
MockDBCallBack same as MockDB but allows to add expectations early to the mock.
MockRows same as LoadCSV() but creates a fully functional driver.Rows interface from a CSV file.
MustConnectDB is a helper function that creates a new database connection using a DSN from an environment variable found in the constant csdb.EnvDSN.
MustGetDSN returns the data source name from an environment variable or panics on error.
MustMockRows same as MockRows but panics on error.
SQLDumpLoad reads all files recognized by `globPattern` argument into MySQL/MariaDB.
SQLMockQuoteMeta hacky work around to remove multiple \s via regexp and replace them with a single whitespace.
WithFile sets the file name.
WithReaderConfig sets CSV reader options.
WithSQLLog displays the SQL query and its named arguments on driver level.
WithTestMode allows better testing.

# Constants

EnvDSN is the name of the environment variable.

# Structs

CSVConfig allows to set special options when parsing the csv file.
SQLDumpOptions can set a different MySQL/MariaDB binary path and adds more arguments.