github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/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/vnforks/kid/v5/store"
    12  )
    13  
    14  type SqlStore interface {
    15  	DriverName() string
    16  	GetCurrentSchemaVersion() string
    17  	GetMaster() *gorp.DbMap
    18  	GetSearchReplica() *gorp.DbMap
    19  	GetReplica() *gorp.DbMap
    20  	TotalMasterDbConnections() int
    21  	TotalReadDbConnections() int
    22  	TotalSearchDbConnections() int
    23  	MarkSystemRanUnitTests()
    24  	DoesTableExist(tablename string) bool
    25  	DoesColumnExist(tableName string, columName string) bool
    26  	DoesTriggerExist(triggerName string) bool
    27  	CreateColumnIfNotExists(tableName string, columnName string, mySqlColType string, postgresColType string, defaultValue string) bool
    28  	CreateColumnIfNotExistsNoDefault(tableName string, columnName string, mySqlColType string, postgresColType string) bool
    29  	RemoveColumnIfExists(tableName string, columnName string) bool
    30  	RemoveTableIfExists(tableName string) bool
    31  	RenameColumnIfExists(tableName string, oldColumnName string, newColumnName string, colType string) bool
    32  	GetMaxLengthOfColumnIfExists(tableName string, columnName string) string
    33  	AlterColumnTypeIfExists(tableName string, columnName string, mySqlColType string, postgresColType string) bool
    34  	AlterColumnDefaultIfExists(tableName string, columnName string, mySqlColDefault *string, postgresColDefault *string) bool
    35  	AlterPrimaryKey(tableName string, columnNames []string) bool
    36  	CreateUniqueIndexIfNotExists(indexName string, tableName string, columnName string) bool
    37  	CreateIndexIfNotExists(indexName string, tableName string, columnName string) bool
    38  	CreateCompositeIndexIfNotExists(indexName string, tableName string, columnNames []string) bool
    39  	CreateFullTextIndexIfNotExists(indexName string, tableName string, columnName string) bool
    40  	RemoveIndexIfExists(indexName string, tableName string) bool
    41  	GetAllConns() []*gorp.DbMap
    42  	Close()
    43  	LockToMaster()
    44  	UnlockFromMaster()
    45  	Branch() store.BranchStore
    46  	Class() store.ClassStore
    47  	Post() store.PostStore
    48  	User() store.UserStore
    49  	Audit() store.AuditStore
    50  	ClusterDiscovery() store.ClusterDiscoveryStore
    51  	Compliance() store.ComplianceStore
    52  	Session() store.SessionStore
    53  	OAuth() store.OAuthStore
    54  	System() store.SystemStore
    55  	Webhook() store.WebhookStore
    56  	Command() store.CommandStore
    57  	CommandWebhook() store.CommandWebhookStore
    58  	Preference() store.PreferenceStore
    59  	License() store.LicenseStore
    60  	Token() store.TokenStore
    61  	Emoji() store.EmojiStore
    62  	Status() store.StatusStore
    63  	FileInfo() store.FileInfoStore
    64  	Reaction() store.ReactionStore
    65  	Job() store.JobStore
    66  	UserAccessToken() store.UserAccessTokenStore
    67  	Role() store.RoleStore
    68  	Scheme() store.SchemeStore
    69  	TermsOfService() store.TermsOfServiceStore
    70  	UserTermsOfService() store.UserTermsOfServiceStore
    71  	LinkMetadata() store.LinkMetadataStore
    72  	getQueryBuilder() sq.StatementBuilderType
    73  }