Documentation
¶
Index ¶
- func Connect(cfg *config.ConnectionConfig) (*sql.DB, error)
- func ListDatabaseSizesQuery(dbType config.DBType) string
- func ListDatabasesQuery(dbType config.DBType) string
- func ListObjectsQuery(dbType config.DBType, objType DBObjectType) string
- func ListTablesQuery(dbType config.DBType) string
- type DBObjectType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(cfg *config.ConnectionConfig) (*sql.DB, error)
Connect opens a database connection, verifies it, and configures a small pool.
func ListDatabaseSizesQuery ¶
ListDatabaseSizesQuery returns the SQL to list databases with their estimated sizes.
func ListDatabasesQuery ¶
ListDatabasesQuery returns the SQL to list databases in a server instance.
func ListObjectsQuery ¶
func ListObjectsQuery(dbType config.DBType, objType DBObjectType) string
ListObjectsQuery returns the SQL to list objects of a given type, or "" if unsupported.
func ListTablesQuery ¶
ListTablesQuery returns the appropriate SQL to list user tables for a DB type
Types ¶
type DBObjectType ¶
type DBObjectType string
DBObjectType represents a category of database objects for introspection.
const ( ObjViews DBObjectType = "Views" ObjFunctions DBObjectType = "Functions" ObjTriggers DBObjectType = "Triggers" ObjStoredProcedures DBObjectType = "Procedures" ObjExtensions DBObjectType = "Extensions" )
func SupportedObjectTypes ¶
func SupportedObjectTypes(dbType config.DBType) []DBObjectType
SupportedObjectTypes returns the object types supported for introspection by a DB type.
Click to show internal directories.
Click to hide internal directories.