Documentation ¶
Overview ¶
Package mssql provides a Gnomock Preset for Microsoft SQL Server database
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Preset ¶
Preset creates a new Gmomock Microsoft SQL Server preset. This preset includes a mssql specific healthcheck function, default mssql image and port, and allows to optionally set up initial state. When used without any configuration, it uses "mydb" database, and "Gn0m!ck~" administrator password (user: sa). You must accept EULA to use this image (WithLicense option)
Types ¶
type Option ¶
type Option func(*P)
Option is an optional configuration of this Gnomock preset. Use available Options to configure the container
func WithAdminPassword ¶
WithAdminPassword sets administrator password that can be used to connect (default: Gn0m!ck~)
func WithDatabase ¶
WithDatabase creates a database with the provided name in the container. If not provided, "mydb" is used by default. WithQueries, if provided, runs against the new database
func WithLicense ¶
WithLicense sets EULA acceptance state. To accept the license, use true. See https://hub.docker.com/_/microsoft-mssql-server?tab=description for more information
func WithQueries ¶
WithQueries executes the provided queries against the database created with WithDatabase, or against default "mydb" database
func WithQueriesFile ¶
WithQueriesFile sets a file name to read initial queries from. Queries from this file are executed before any other queries provided in WithQueries
func WithVersion ¶ added in v0.9.0
WithVersion sets image version.
type P ¶
type P struct { DB string `json:"db"` Password string `json:"password"` Queries []string `json:"queries"` QueriesFiles []string `json:"queries_files"` License bool `json:"license"` Version string `json:"version"` }
P is a Gnomock Preset implementation of Microsoft SQL Server database
func (*P) Ports ¶
func (p *P) Ports() gnomock.NamedPorts
Ports returns ports that should be used to access this container