github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/store/sqlstore/store.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package sqlstore
     5  
     6  import (
     7  	sq "github.com/Masterminds/squirrel"
     8  	_ "github.com/go-sql-driver/mysql"
     9  	_ "github.com/lib/pq"
    10  	"github.com/mattermost/gorp"
    11  	"github.com/mattermost/mattermost-server/v5/store"
    12  )
    13  
    14  /*type SqlStore struct {
    15  	master         *gorp.DbMap
    16  	replicas       []*gorp.DbMap
    17  	searchReplicas []*gorp.DbMap
    18  	team           TeamStore
    19  	channel        ChannelStore
    20  	post           PostStore
    21  	user           UserStore
    22  	audit          AuditStore
    23  	compliance     ComplianceStore
    24  	session        SessionStore
    25  	oauth          OAuthStore
    26  	system         SystemStore
    27  	webhook        WebhookStore
    28  	command        CommandStore
    29  	preference     PreferenceStore
    30  	license        LicenseStore
    31  	token          TokenStore
    32  	emoji          EmojiStore
    33  	status         StatusStore
    34  	fileInfo       FileInfoStore
    35  	reaction       ReactionStore
    36  	jobStatus      JobStatusStore
    37  	SchemaVersion  string
    38  	rrCounter      int64
    39  	srCounter      int64
    40  }*/
    41  
    42  type SqlStore interface {
    43  	DriverName() string
    44  	GetCurrentSchemaVersion() string
    45  	GetMaster() *gorp.DbMap
    46  	GetSearchReplica() *gorp.DbMap
    47  	GetReplica() *gorp.DbMap
    48  	GetDbVersion() (string, error)
    49  	TotalMasterDbConnections() int
    50  	TotalReadDbConnections() int
    51  	TotalSearchDbConnections() int
    52  	MarkSystemRanUnitTests()
    53  	DoesTableExist(tablename string) bool
    54  	DoesColumnExist(tableName string, columName string) bool
    55  	DoesTriggerExist(triggerName string) bool
    56  	CreateColumnIfNotExists(tableName string, columnName string, mySqlColType string, postgresColType string, defaultValue string) bool
    57  	CreateColumnIfNotExistsNoDefault(tableName string, columnName string, mySqlColType string, postgresColType string) bool
    58  	RemoveColumnIfExists(tableName string, columnName string) bool
    59  	RemoveTableIfExists(tableName string) bool
    60  	RenameColumnIfExists(tableName string, oldColumnName string, newColumnName string, colType string) bool
    61  	GetMaxLengthOfColumnIfExists(tableName string, columnName string) string
    62  	AlterColumnTypeIfExists(tableName string, columnName string, mySqlColType string, postgresColType string) bool
    63  	AlterColumnDefaultIfExists(tableName string, columnName string, mySqlColDefault *string, postgresColDefault *string) bool
    64  	AlterPrimaryKey(tableName string, columnNames []string) bool
    65  	CreateUniqueIndexIfNotExists(indexName string, tableName string, columnName string) bool
    66  	CreateIndexIfNotExists(indexName string, tableName string, columnName string) bool
    67  	CreateCompositeIndexIfNotExists(indexName string, tableName string, columnNames []string) bool
    68  	CreateUniqueCompositeIndexIfNotExists(indexName string, tableName string, columnNames []string) bool
    69  	CreateFullTextIndexIfNotExists(indexName string, tableName string, columnName string) bool
    70  	RemoveIndexIfExists(indexName string, tableName string) bool
    71  	GetAllConns() []*gorp.DbMap
    72  	Close()
    73  	LockToMaster()
    74  	UnlockFromMaster()
    75  	Team() store.TeamStore
    76  	Channel() store.ChannelStore
    77  	Post() store.PostStore
    78  	User() store.UserStore
    79  	Bot() store.BotStore
    80  	Audit() store.AuditStore
    81  	ClusterDiscovery() store.ClusterDiscoveryStore
    82  	Compliance() store.ComplianceStore
    83  	Session() store.SessionStore
    84  	OAuth() store.OAuthStore
    85  	System() store.SystemStore
    86  	Webhook() store.WebhookStore
    87  	Command() store.CommandStore
    88  	CommandWebhook() store.CommandWebhookStore
    89  	Preference() store.PreferenceStore
    90  	License() store.LicenseStore
    91  	Token() store.TokenStore
    92  	Emoji() store.EmojiStore
    93  	Status() store.StatusStore
    94  	FileInfo() store.FileInfoStore
    95  	Reaction() store.ReactionStore
    96  	Job() store.JobStore
    97  	Plugin() store.PluginStore
    98  	UserAccessToken() store.UserAccessTokenStore
    99  	Role() store.RoleStore
   100  	Scheme() store.SchemeStore
   101  	TermsOfService() store.TermsOfServiceStore
   102  	UserTermsOfService() store.UserTermsOfServiceStore
   103  	LinkMetadata() store.LinkMetadataStore
   104  	getQueryBuilder() sq.StatementBuilderType
   105  }