Versions in this module Expand all Collapse all v1 v1.0.0 Jun 4, 2021 Changes in this version + var OpenDB = openDB + func AutoMigrate(values ...interface{}) + func AutoUpgrade(name string, grade func(*gorm.DB) error) + func Commands(getContext func() context.Context, getClient func() DBAdminClient) (commands []*cobra.Command) + func Config(v *viper.Viper) + func DB() *gorm.DB + func NewOrders(s string, m ...[2]string) (orders []string) + func Register(server *grpc.Server) + func RegisterDBAdminServer(s *grpc.Server, srv DBAdminServer) + func SetDB(db *gorm.DB) + func Sortby(db *gorm.DB, s string, m ...[2]string) *gorm.DB + func StartListen() + func TableNames() (names []string) + type DBAdminClient interface + Exec func(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecReply, error) + Query func(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryReply, error) + Stats func(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) + Tables func(ctx context.Context, in *TablesRequest, opts ...grpc.CallOption) (*TablesReply, error) + func NewDBAdminClient(cc *grpc.ClientConn) DBAdminClient + type DBAdminServer interface + Exec func(context.Context, *ExecRequest) (*ExecReply, error) + Query func(context.Context, *QueryRequest) (*QueryReply, error) + Stats func(context.Context, *StatsRequest) (*StatsReply, error) + Tables func(context.Context, *TablesRequest) (*TablesReply, error) + type ExecReply struct + Affected int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ExecReply) Descriptor() ([]byte, []int) + func (*ExecReply) ProtoMessage() + func (m *ExecReply) GetAffected() int64 + func (m *ExecReply) Reset() + func (m *ExecReply) String() string + func (m *ExecReply) XXX_DiscardUnknown() + func (m *ExecReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ExecReply) XXX_Merge(src proto.Message) + func (m *ExecReply) XXX_Size() int + func (m *ExecReply) XXX_Unmarshal(b []byte) error + type ExecRequest struct + Sql string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ExecRequest) Descriptor() ([]byte, []int) + func (*ExecRequest) ProtoMessage() + func (m *ExecRequest) GetSql() string + func (m *ExecRequest) Reset() + func (m *ExecRequest) String() string + func (m *ExecRequest) XXX_DiscardUnknown() + func (m *ExecRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ExecRequest) XXX_Merge(src proto.Message) + func (m *ExecRequest) XXX_Size() int + func (m *ExecRequest) XXX_Unmarshal(b []byte) error + type QueryReply struct + Result []*Result + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*QueryReply) Descriptor() ([]byte, []int) + func (*QueryReply) ProtoMessage() + func (m *QueryReply) GetResult() []*Result + func (m *QueryReply) Reset() + func (m *QueryReply) String() string + func (m *QueryReply) XXX_DiscardUnknown() + func (m *QueryReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *QueryReply) XXX_Merge(src proto.Message) + func (m *QueryReply) XXX_Size() int + func (m *QueryReply) XXX_Unmarshal(b []byte) error + type QueryRequest struct + Sql string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*QueryRequest) Descriptor() ([]byte, []int) + func (*QueryRequest) ProtoMessage() + func (m *QueryRequest) GetSql() string + func (m *QueryRequest) Reset() + func (m *QueryRequest) String() string + func (m *QueryRequest) XXX_DiscardUnknown() + func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *QueryRequest) XXX_Merge(src proto.Message) + func (m *QueryRequest) XXX_Size() int + func (m *QueryRequest) XXX_Unmarshal(b []byte) error + type Result struct + Values []string + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Result) Descriptor() ([]byte, []int) + func (*Result) ProtoMessage() + func (m *Result) GetValues() []string + func (m *Result) Reset() + func (m *Result) String() string + func (m *Result) XXX_DiscardUnknown() + func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Result) XXX_Merge(src proto.Message) + func (m *Result) XXX_Size() int + func (m *Result) XXX_Unmarshal(b []byte) error + type Stats struct + Idle int64 + InUse int64 + MaxIdleClosed int64 + MaxLifetimeClosed int64 + MaxOpenConnections int64 + OpenConnections int64 + WaitCount int64 + WaitDuration int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Stats) Descriptor() ([]byte, []int) + func (*Stats) ProtoMessage() + func (m *Stats) GetIdle() int64 + func (m *Stats) GetInUse() int64 + func (m *Stats) GetMaxIdleClosed() int64 + func (m *Stats) GetMaxLifetimeClosed() int64 + func (m *Stats) GetMaxOpenConnections() int64 + func (m *Stats) GetOpenConnections() int64 + func (m *Stats) GetWaitCount() int64 + func (m *Stats) GetWaitDuration() int64 + func (m *Stats) Reset() + func (m *Stats) String() string + func (m *Stats) XXX_DiscardUnknown() + func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Stats) XXX_Merge(src proto.Message) + func (m *Stats) XXX_Size() int + func (m *Stats) XXX_Unmarshal(b []byte) error + type StatsReply struct + Stats *Stats + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*StatsReply) Descriptor() ([]byte, []int) + func (*StatsReply) ProtoMessage() + func (m *StatsReply) GetStats() *Stats + func (m *StatsReply) Reset() + func (m *StatsReply) String() string + func (m *StatsReply) XXX_DiscardUnknown() + func (m *StatsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *StatsReply) XXX_Merge(src proto.Message) + func (m *StatsReply) XXX_Size() int + func (m *StatsReply) XXX_Unmarshal(b []byte) error + type StatsRequest struct + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*StatsRequest) Descriptor() ([]byte, []int) + func (*StatsRequest) ProtoMessage() + func (m *StatsRequest) Reset() + func (m *StatsRequest) String() string + func (m *StatsRequest) XXX_DiscardUnknown() + func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *StatsRequest) XXX_Merge(src proto.Message) + func (m *StatsRequest) XXX_Size() int + func (m *StatsRequest) XXX_Unmarshal(b []byte) error + type Table struct + Deleted int64 + Error string + Rows int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Table) Descriptor() ([]byte, []int) + func (*Table) ProtoMessage() + func (m *Table) GetDeleted() int64 + func (m *Table) GetError() string + func (m *Table) GetRows() int64 + func (m *Table) Reset() + func (m *Table) String() string + func (m *Table) XXX_DiscardUnknown() + func (m *Table) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Table) XXX_Merge(src proto.Message) + func (m *Table) XXX_Size() int + func (m *Table) XXX_Unmarshal(b []byte) error + type TablesReply struct + Tables map[string]*Table + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*TablesReply) Descriptor() ([]byte, []int) + func (*TablesReply) ProtoMessage() + func (m *TablesReply) GetTables() map[string]*Table + func (m *TablesReply) Reset() + func (m *TablesReply) String() string + func (m *TablesReply) XXX_DiscardUnknown() + func (m *TablesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *TablesReply) XXX_Merge(src proto.Message) + func (m *TablesReply) XXX_Size() int + func (m *TablesReply) XXX_Unmarshal(b []byte) error + type TablesRequest struct + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*TablesRequest) Descriptor() ([]byte, []int) + func (*TablesRequest) ProtoMessage() + func (m *TablesRequest) Reset() + func (m *TablesRequest) String() string + func (m *TablesRequest) XXX_DiscardUnknown() + func (m *TablesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *TablesRequest) XXX_Merge(src proto.Message) + func (m *TablesRequest) XXX_Size() int + func (m *TablesRequest) XXX_Unmarshal(b []byte) error + type UnimplementedDBAdminServer struct + func (*UnimplementedDBAdminServer) Exec(ctx context.Context, req *ExecRequest) (*ExecReply, error) + func (*UnimplementedDBAdminServer) Query(ctx context.Context, req *QueryRequest) (*QueryReply, error) + func (*UnimplementedDBAdminServer) Stats(ctx context.Context, req *StatsRequest) (*StatsReply, error) + func (*UnimplementedDBAdminServer) Tables(ctx context.Context, req *TablesRequest) (*TablesReply, error)