mssql

package
v0.0.0-...-1e48046 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseUserId

func ParseUserId(id string) (database string, username string, err error)

Types

type AzureLogin

type AzureLogin struct {
	TenantID     string `json:"tenant_id,omitempty"`
	ClientID     string `json:"client_id,omitempty"`
	ClientSecret string `json:"client_secret,omitempty"`
}

type Connector

type Connector struct {
	Host       string `json:"host"`
	Port       int    `json:"port"`
	Database   string `json:"database"`
	Login      *LoginUser
	AzureLogin *AzureLogin
	Timeout    time.Duration `json:"timeout,omitempty"`
	Token      string
}

func (*Connector) ConnectionString

func (c *Connector) ConnectionString() string

func (*Connector) CreateUser

func (c *Connector) CreateUser(ctx context.Context, user *model.User) error

func (*Connector) CreateUserOld

func (c *Connector) CreateUserOld(ctx context.Context, database string, user *model.User) error

func (*Connector) DeleteUser

func (c *Connector) DeleteUser(ctx context.Context, user *model.User) error

func (*Connector) ExecContext

func (c *Connector) ExecContext(ctx context.Context, command string, args ...interface{}) error

Execute an SQL statement and ignore the results

func (*Connector) GetUser

func (c *Connector) GetUser(ctx context.Context, database string, username string) (*model.User, error)

func (*Connector) GetUserOld

func (c *Connector) GetUserOld(ctx context.Context, database, username string) (*model.User, error)

func (*Connector) GetUserRoles

func (c *Connector) GetUserRoles(ctx context.Context, username string) ([]string, error)

func (*Connector) PingContext

func (c *Connector) PingContext(ctx context.Context) error

func (*Connector) QueryContext

func (c *Connector) QueryContext(ctx context.Context, query string, scanner func(*sql.Rows) error, args ...interface{}) error

func (*Connector) QueryRowContext

func (c *Connector) QueryRowContext(ctx context.Context, query string, scanner func(*sql.Row) error, args ...interface{}) error

func (*Connector) UpdateUser

func (c *Connector) UpdateUser(ctx context.Context, database string, user *model.User) error

type LoginUser

type LoginUser struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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