sql

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFactory

func GetFactory() model.ConnectorFactory

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       string `json:"port"`
	Database   string `json:"database"`
	Login      *LoginUser
	AzureLogin *AzureLogin
	Timeout    time.Duration `json:"timeout,omitempty"`
	Token      string
}

func (*Connector) CreateLogin

func (c *Connector) CreateLogin(ctx context.Context, name, password, defaultDatabase, defaultLanguage string) error

func (*Connector) CreateUser

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

func (*Connector) DeleteLogin

func (c *Connector) DeleteLogin(ctx context.Context, name string) error

func (*Connector) DeleteUser

func (c *Connector) DeleteUser(ctx context.Context, database, username string) 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) GetLogin

func (c *Connector) GetLogin(ctx context.Context, name string) (*model.Login, error)

func (*Connector) GetUser

func (c *Connector) GetUser(ctx context.Context, database, username string) (*model.User, 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) UpdateLogin

func (c *Connector) UpdateLogin(ctx context.Context, name, password, defaultDatabase, defaultLanguage string) 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