Documentation ¶
Overview ¶
Package testhelpers contains some helpers shared between different test packages
Index ¶
- Constants
- func Connect(username, password, database string, port int) *sql.DB
- func ConnectDefaultDB(username, password string, port int) *sql.DB
- func FreePort() int
- func RandomDatabaseName() string
- func RandomPassword() string
- func RandomSchemaName(prefixes ...string) string
- func RandomTableName() string
- func UserExists(db *sql.DB, username string) bool
- type Encoder
- type ServerOption
- type ShutdownServerFn
Constants ¶
View Source
const ( AdminUser = "sa" Server = "localhost" TestDatabase = "testdb" )
Variables ¶
This section is empty.
Functions ¶
func RandomDatabaseName ¶
func RandomDatabaseName() string
func RandomPassword ¶
func RandomPassword() string
func RandomSchemaName ¶
func RandomTableName ¶
func RandomTableName() string
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) EncodeWithoutDB ¶
type ServerOption ¶
func WithDatabase ¶
func WithDatabase() ServerOption
func WithNoop ¶
func WithNoop() ServerOption
func WithSPConfigure ¶
func WithSPConfigure() ServerOption
type ShutdownServerFn ¶
func StartServer ¶
func StartServer(password string, port int, opts ...ServerOption) ShutdownServerFn
Click to show internal directories.
Click to hide internal directories.