Documentation
¶
Overview ¶
Package mockservers provides mock database servers for testing. These can be reused across driver tests and integration tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResultSetMetaData ¶
ResultSetMetaData describes the result set columns.
type RowType ¶
type RowType struct {
Name string `json:"name"`
Type string `json:"type"`
Nullable bool `json:"nullable"`
}
RowType describes a single column.
type SnowflakeResponse ¶
type SnowflakeResponse struct {
ResultSetMetaData *ResultSetMetaData `json:"resultSetMetaData,omitempty"`
Data [][]string `json:"data,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
SQLState string `json:"sqlState,omitempty"`
}
SnowflakeResponse represents a Snowflake SQL API response.
type SnowflakeServer ¶
type SnowflakeServer struct {
Server *httptest.Server
// Queries records all SQL statements received.
Queries []string
// CustomHandler allows overriding the default behavior per test.
CustomHandler func(sql string) (*SnowflakeResponse, int)
// contains filtered or unexported fields
}
SnowflakeServer is a mock Snowflake SQL REST API v2 server.
func NewSnowflakeServer ¶
func NewSnowflakeServer() *SnowflakeServer
NewSnowflakeServer creates a mock Snowflake server with default table data.
func (*SnowflakeServer) URL ¶
func (s *SnowflakeServer) URL() string
URL returns the base URL of the mock server.
Click to show internal directories.
Click to hide internal directories.