Documentation
¶
Index ¶
- Constants
- func RunAllTests(m *testing.M, driverName, dataSourceName, dockerArgs string)
- func RunTestDataTypes(t *testing.T, driverName, dataSourceName string)
- func RunTestFloatLiterals(t *testing.T, driverName, dataSourceName string)
- func RunTestInsert(t *testing.T, driverName, dataSourceName string)
- func RunTestMultiStatement(t *testing.T, driverName, dataSourceName string)
- func RunTestQuery(t *testing.T, driverName, dataSourceName string)
- func RunTestSqlx(t *testing.T, driverName, dataSourceName string)
- func RunTestTxns(t *testing.T, driverName, dataSourceName string)
- type DataTypes
Constants ¶
const ( // PostgresDockerArgs starts up an instance of CRDB in order to test // Postgres drivers. // NOTE: Don't use default CRDB port in case another instance is already // running. PostgresDockerArgs = "-p 26888:26257 cockroachdb/cockroach:v20.2.4 start-single-node --insecure" // PostgresDataSourceName is the string used to connect to CRDB in order to // test Postgres drivers. PostgresDataSourceName = "postgresql://root@localhost:26888?sslmode=disable" )
Variables ¶
This section is empty.
Functions ¶
func RunAllTests ¶
RunTests is called by other driver-specific test packages (like pgxtest and pqtest) in order to set up the test environment and then run all tests. It registers a copyist driver and starts up a SQL docker instance if in recording mode. It then runs all tests by calling testing.M.Run(), and finally exits the process when complete.
func RunTestDataTypes ¶
RunTestDataTypes queries data types that are interesting for the SQL driver.
func RunTestFloatLiterals ¶
RunTestFloatLiterals tests the generation of float literal values, with and without fractions and exponents.
func RunTestInsert ¶
RunTestInsert inserts a row and ensures that it's been committed.
func RunTestMultiStatement ¶
RunTestMultiStatement runs multiple SQL statements in a single Exec/Query operation.
func RunTestQuery ¶
RunTestQuery performs operations directly on a DB.
func RunTestSqlx ¶
RunTestSqlx tests usage of the `sqlx` package with copyist.
func RunTestTxns ¶
RunTestTxns commits and aborts transactions.