Documentation ¶
Index ¶
- Variables
- func AnalyzeQuery(c *gin.Context)
- func Connect(c *gin.Context)
- func ConnectWithBackend(c *gin.Context)
- func ConnectWithBookmark(id string) (*client.Client, error)
- func ConnectWithURL(c *gin.Context) (*client.Client, error)
- func DB(c *gin.Context) *client.Client
- func DataExport(c *gin.Context)
- func Disconnect(c *gin.Context)
- func ExplainQuery(c *gin.Context)
- func GetActivity(c *gin.Context)
- func GetAssets(prefix string) http.Handler
- func GetBookmarks(c *gin.Context)
- func GetConnectionInfo(c *gin.Context)
- func GetDatabases(c *gin.Context)
- func GetFunction(c *gin.Context)
- func GetHistory(c *gin.Context)
- func GetHome(prefix string) http.Handler
- func GetInfo(c *gin.Context)
- func GetLocalQueries(c *gin.Context)
- func GetObjects(c *gin.Context)
- func GetSchemas(c *gin.Context)
- func GetSessions(c *gin.Context)
- func GetTable(c *gin.Context)
- func GetTableConstraints(c *gin.Context)
- func GetTableIndexes(c *gin.Context)
- func GetTableInfo(c *gin.Context)
- func GetTableRows(c *gin.Context)
- func GetTablesStats(c *gin.Context)
- func HandleQuery(query string, c *gin.Context)
- func RequestLogger(logger *logrus.Logger) gin.HandlerFunc
- func RunLocalQuery(c *gin.Context)
- func RunQuery(c *gin.Context)
- func SetLogger(l *logrus.Logger)
- func SetupMetrics(engine *gin.Engine)
- func SetupMiddlewares(group *gin.RouterGroup)
- func SetupRoutes(router *gin.Engine)
- func SwitchDb(c *gin.Context)
- type Backend
- type BackendCredential
- type BackendRequest
- type Error
- type SessionManager
- func (m *SessionManager) Add(id string, conn *client.Client)
- func (m *SessionManager) Cleanup() int
- func (m *SessionManager) Get(id string) *client.Client
- func (m *SessionManager) IDs() []string
- func (m *SessionManager) Len() int
- func (m *SessionManager) Remove(id string) bool
- func (m *SessionManager) RunPeriodicCleanup()
- func (m *SessionManager) Sessions() map[string]*client.Client
- func (m *SessionManager) SetIdleTimeout(timeout time.Duration)
Constants ¶
This section is empty.
Variables ¶
var ( // DbClient represents the active database connection in a single-session mode DbClient *client.Client // DbSessions represents the mapping for client connections DbSessions *SessionManager // QueryStore reads the SQL queries stores in the home directory QueryStore *queries.Store )
Functions ¶
func AnalyzeQuery ¶ added in v0.11.10
AnalyzeQuery renders query explain plan and analyze profile
func ConnectWithBackend ¶ added in v0.9.9
ConnectWithBackend creates a new connection based on backend resource
func ConnectWithBookmark ¶ added in v0.13.0
func DataExport ¶ added in v0.9.9
DataExport performs database table export
func Disconnect ¶ added in v0.9.2
Disconnect closes the current database connection
func GetBookmarks ¶
GetBookmarks renders the list of available bookmarks
func GetConnectionInfo ¶
GetConnectionInfo renders information about current connection
func GetDatabases ¶
GetDatabases renders a list of all databases on the server
func GetFunction ¶ added in v0.12.0
GetFunction renders function information
func GetLocalQueries ¶ added in v0.14.0
func GetObjects ¶ added in v0.9.0
GetObjects renders a list of database objects
func GetSessions ¶ added in v0.8.0
GetSessions renders the number of active sessions
func GetTableConstraints ¶ added in v0.7.0
GetTableConstraints renders a list of database constraints
func GetTableIndexes ¶
GetTableIndexes renders a list of database table indexes
func GetTableInfo ¶
GetTableInfo renders a selected table information
func GetTablesStats ¶ added in v0.14.0
GetTablesStats renders data sizes and estimated rows for all tables in the database
func HandleQuery ¶
HandleQuery runs the database query
func RequestLogger ¶ added in v0.12.0
func RequestLogger(logger *logrus.Logger) gin.HandlerFunc
func RunLocalQuery ¶ added in v0.14.0
func SetupMetrics ¶ added in v0.13.0
func SetupMiddlewares ¶ added in v0.6.3
func SetupMiddlewares(group *gin.RouterGroup)
func SetupRoutes ¶
Types ¶
type Backend ¶ added in v0.9.9
Backend represents a third party configuration source
func (Backend) FetchCredential ¶ added in v0.9.9
func (be Backend) FetchCredential(ctx context.Context, resource string, c *gin.Context) (*BackendCredential, error)
FetchCredential sends an authentication request to a third-party service
type BackendCredential ¶ added in v0.9.9
type BackendCredential struct {
DatabaseURL string `json:"database_url"`
}
BackendCredential represents the third-party response
type BackendRequest ¶ added in v0.9.9
type BackendRequest struct { Resource string `json:"resource"` Token string `json:"token"` Headers map[string]string `json:"headers"` }
BackendRequest represents a payload sent to the third-party source
type SessionManager ¶ added in v0.12.0
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶ added in v0.12.0
func NewSessionManager(logger *logrus.Logger) *SessionManager
func (*SessionManager) Add ¶ added in v0.12.0
func (m *SessionManager) Add(id string, conn *client.Client)
func (*SessionManager) Cleanup ¶ added in v0.12.0
func (m *SessionManager) Cleanup() int
func (*SessionManager) Get ¶ added in v0.12.0
func (m *SessionManager) Get(id string) *client.Client
func (*SessionManager) IDs ¶ added in v0.12.0
func (m *SessionManager) IDs() []string
func (*SessionManager) Len ¶ added in v0.12.0
func (m *SessionManager) Len() int
func (*SessionManager) Remove ¶ added in v0.12.0
func (m *SessionManager) Remove(id string) bool
func (*SessionManager) RunPeriodicCleanup ¶ added in v0.12.0
func (m *SessionManager) RunPeriodicCleanup()
func (*SessionManager) Sessions ¶ added in v0.12.0
func (m *SessionManager) Sessions() map[string]*client.Client
func (*SessionManager) SetIdleTimeout ¶ added in v0.12.0
func (m *SessionManager) SetIdleTimeout(timeout time.Duration)