mssql

package
v1.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MPL-2.0 Imports: 14 Imported by: 69

README

Testing

To run these tests, first start MSSQL in Docker. Please do make sure to view the EULA before accepting it as it includes limits on the number of users per company who can be using the image, and how it can be used in testing.

sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \
   -p 1433:1433 --name sql1 \
   -d mcr.microsoft.com/mssql/server:2017-latest

Then use the following env variables for testing:

export VAULT_ACC=1
export MSSQL_URL="sqlserver://SA:%3CYourStrong%21Passw0rd%3E@localhost:1433"

Note that the SA password passed into the Docker container differs from the one passed into the tests. It's the same password, but Go's libraries require it to be percent encoded.

Running all the tests at once against one Docker container will likely fail because they interact with each other. Consider running one test at a time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (interface{}, error)

Types

type MSSQL

type MSSQL struct {
	*connutil.SQLConnectionProducer
	// contains filtered or unexported fields
}

MSSQL is an implementation of Database interface

func (*MSSQL) DeleteUser added in v1.6.0

func (m *MSSQL) DeleteUser(ctx context.Context, req dbplugin.DeleteUserRequest) (dbplugin.DeleteUserResponse, error)

DeleteUser attempts to drop the specified user. It will first attempt to disable login, then kill pending connections from that user, and finally drop the user and login from the database instance.

func (*MSSQL) Initialize added in v1.6.0

func (m *MSSQL) Initialize(ctx context.Context, req dbplugin.InitializeRequest) (dbplugin.InitializeResponse, error)

func (*MSSQL) NewUser added in v1.6.0

func (m *MSSQL) NewUser(ctx context.Context, req dbplugin.NewUserRequest) (dbplugin.NewUserResponse, error)

NewUser generates the username/password on the underlying MSSQL secret backend as instructed by the statements provided.

func (*MSSQL) Type

func (m *MSSQL) Type() (string, error)

Type returns the TypeName for this backend

func (*MSSQL) UpdateUser added in v1.6.0

func (m *MSSQL) UpdateUser(ctx context.Context, req dbplugin.UpdateUserRequest) (dbplugin.UpdateUserResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL