Documentation
¶
Index ¶
- Constants
- Variables
- func AddSingleQuotesJoin(s []string) string
- func CanPubToAll(accountName, pubAllAccounts string) bool
- func InSubMetaTables(m *plan.SubscriptionMeta, tableName string) bool
- func JoinAccountIds(accIds []int32) (s string)
- func JoinAccounts(accountMap map[int32]*AccountInfo) string
- func RemoveTable(oldTableListStr, tblName string) string
- func SplitAccounts(s string) (accounts []string)
- type AccountInfo
- type PubInfo
- type SubInfo
- type SubStatus
Constants ¶
View Source
const ( // AccountAll is the value of account_list column in table mo_pubs AccountAll = "all" // AccountAllOutput is the value of sub_account column of command `show publication` AccountAllOutput = "*" // TableAll is the value of table_list column in table mo_pubs TableAll = "*" Sep = "," // PubAllAccounts is the accounts which have privilege to publish to-all publications, separated by comma PubAllAccounts = "*" )
Variables ¶
View Source
var GetAccounts = func(txn executor.TxnExecutor) (nameInfoMap map[string]*AccountInfo, idInfoMap map[int32]*AccountInfo, err error) { sql := "select account_id, account_name, status, version, suspended_time from mo_catalog.mo_account where 1=1" res, err := txn.Exec(sql, executor.StatementOption{}.WithAccountID(0)) if err != nil { return } defer res.Close() nameInfoMap = make(map[string]*AccountInfo) idInfoMap = make(map[int32]*AccountInfo) res.ReadRows(func(rows int, cols []*vector.Vector) bool { for i := 0; i < rows; i++ { var accountInfo AccountInfo accountInfo.Id = vector.GetFixedAtWithTypeCheck[int32](cols[0], i) accountInfo.Name = cols[1].GetStringAt(i) accountInfo.Status = cols[2].GetStringAt(i) accountInfo.Version = vector.GetFixedAtWithTypeCheck[uint64](cols[3], i) if !cols[4].IsNull(uint64(i)) { accountInfo.SuspendedTime = vector.GetFixedAtWithTypeCheck[types.Timestamp](cols[4], i).String2(time.Local, cols[4].GetType().Scale) } else { accountInfo.SuspendedTime = "" } nameInfoMap[accountInfo.Name] = &accountInfo idInfoMap[accountInfo.Id] = &accountInfo } return true }) return }
GetAccounts returns nameInfoMap: map[accName] -> AccountInfo idInfoMap: map[accId] -> AccountInfo
Functions ¶
func AddSingleQuotesJoin ¶
func CanPubToAll ¶
func InSubMetaTables ¶
func InSubMetaTables(m *plan.SubscriptionMeta, tableName string) bool
func JoinAccountIds ¶
func JoinAccounts ¶
func JoinAccounts(accountMap map[int32]*AccountInfo) string
func RemoveTable ¶
func SplitAccounts ¶
Types ¶
type AccountInfo ¶
type PubInfo ¶
type PubInfo struct {
PubAccountId uint32
PubAccountName string
PubName string
DbName string
DbId uint64
TablesStr string
SubAccountsStr string
CreateTime string
UpdateTime string
Owner uint32
Creator uint32
Comment string
}
func (*PubInfo) GetCreateSql ¶
func (*PubInfo) GetSubAccountNames ¶
func (*PubInfo) InSubAccounts ¶
Click to show internal directories.
Click to hide internal directories.