sql

package
v0.0.0-...-daea707 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ClientCertificatePasswordEnv = "TFSQL_AZURE_CLIENT_CERTIFICATE_PASSWORD"
View Source
const ClientCertificatePathEnv = "TFSQL_AZURE_CLIENT_CERTIFICATE_PATH"
View Source
const ClientIdEnv = "TFSQL_AZURE_CLIENT_ID"
View Source
const ClientSecretEnv = "TFSQL_AZURE_CLIENT_SECRET"
View Source
const ConnectionStringEnv = "TFSQL_CONNECTION_STRING"
View Source
const SubscriptionIdEnv = "TFSQL_AZURE_SUBSCRIPTION_ID"
View Source
const TenantIdEnv = "TFSQL_AZURE_TENANT_ID"
View Source
const UseCliEnv = "TFSQL_AZURE_USE_CLI"
View Source
const UseMsiEnv = "TFSQL_AZURE_USE_MSI"
View Source
const UserlessConnectionStringEnv = "TFSQL_USERLESS_CONNECTION_STRING"

Variables

This section is empty.

Functions

func DisposeConnections

func DisposeConnections() error

Types

type SqlClient

type SqlClient struct {
	Db *sql.DB
	Id string
}

func CreatePooledSqlClient

func CreatePooledSqlClient(config SqlClientConfig) (*SqlClient, error)

func CreateSqlClient

func CreateSqlClient(config SqlClientConfig) (*SqlClient, error)

type SqlClientConfig

type SqlClientConfig struct {
	ConnectionString string
}

type SqlUser

type SqlUser struct {
	Name          string
	Password      string
	ExternalLogin bool
}

type SqlUserClient

type SqlUserClient interface {
	Get(name string) (*SqlUser, error)
	Create(user *SqlUser) error
	ChangePassword(name, password string) error
	Delete(name string) error
}

func CreateSqlUserClient

func CreateSqlUserClient(client *SqlClient) SqlUserClient

type SqlUserRole

type SqlUserRole struct {
	User string
	Role string
}

type SqlUserRoleClient

type SqlUserRoleClient interface {
	Exists(role SqlUserRole) (bool, error)
	Grant(role SqlUserRole) error
	Revoke(role SqlUserRole) error
}

func CreateSqlUserRoleClient

func CreateSqlUserRoleClient(client *SqlClient) SqlUserRoleClient

Jump to

Keyboard shortcuts

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