sqlstore

package
v0.0.0-...-129ad96 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN = iota
	QUESTION
	DOLLAR
	NAMED
	AT
)

Below is copied from sqlx/bind.go to handle escaping question marks. TODO: make work for QUESTION bind types (eg mysql)

Variables

This section is empty.

Functions

func NewPropertyFieldStore

func NewPropertyFieldStore(pluginAPI PluginAPIClient, sqlStore *SQLStore) app.PropertyFieldStore

func NewPropertyStore

func NewPropertyStore(pluginAPI PluginAPIClient, sqlStore *SQLStore) app.PropertyStore

func NewViewMemberStore

func NewViewMemberStore(pluginAPI PluginAPIClient, sqlStore *SQLStore) app.ViewMemberStore

func NewViewStore

func NewViewStore(pluginAPI PluginAPIClient, sqlStore *SQLStore) app.ViewStore

func Rebind

func Rebind(bindType int, query string) string

Types

type ConfigurationAPI

type ConfigurationAPI interface {
	GetConfig() *model.Config
}

type ConstraintsInfo

type ConstraintsInfo struct {
	ConstraintName string
	TableName      string
	ConstraintType string
}

type IndexInfo

type IndexInfo struct {
	TableName string
	IndexName string

	// Postgres specific field
	IndexDef string

	// MySQL specific fields
	ColumnName string
}

type KVAPI

type KVAPI interface {
	Get(key string, out interface{}) error
}

KVAPI is the key value store interface for the pluginkv stores. It is implemented by mattermost-plugin-api/Client.KV, or by the mock KVAPI.

type PluginAPIClient

type PluginAPIClient struct {
	Store         StoreAPI
	KV            KVAPI
	Configuration ConfigurationAPI
}

PluginAPIClient is the struct combining the interfaces defined above, which is everything from pluginapi that the store currently uses.

func NewClient

func NewClient(api *pluginapi.Client) PluginAPIClient

NewClient receives a pluginapi.Client and returns the PluginAPIClient, which is what the store will use to access pluginapi.Client.

type SQLStore

type SQLStore struct {
	// contains filtered or unexported fields
}

func New

func New(pluginAPI PluginAPIClient) (*SQLStore, error)

New constructs a new instance of SQLStore.

func (*SQLStore) RunMigrations

func (sqlStore *SQLStore) RunMigrations() error

RunMigrations will run the migrations (if any). The caller should hold a cluster mutex if there is a danger of this being run on multiple servers at once.

type StoreAPI

type StoreAPI interface {
	GetMasterDB() (*sql.DB, error)
	DriverName() string
}

StoreAPI is the interface exposing the underlying database, provided by pluginapi It is implemented by mattermost-plugin-api/Client.Store, or by the mock StoreAPI.

type TableInfo

type TableInfo struct {
	TableName              string
	ColumnName             string
	DataType               string
	IsNullable             string
	ColumnKey              string
	ColumnDefault          *string
	Extra                  string
	CharacterMaximumLength *string
}

Jump to

Keyboard shortcuts

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