Documentation
¶
Index ¶
- func ConnectDB(cfg *config.ConnectionConfig) (*sql.DB, error)
- func FormatBytes(bytes uint64) string
- 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 ConnectDB ¶
func ConnectDB(cfg *config.ConnectionConfig) (*sql.DB, error)
ConnectDB opens a database connection, pings it, and sets sensible defaults.
func FormatBytes ¶
FormatBytes converts bytes to a human-readable string (e.g., "12.5 MB")
func ListDatabaseSizesQuery ¶ added in v0.4.1
ListDatabaseSizesQuery returns the SQL to list databases with their estimated sizes.
func ListDatabasesQuery ¶ added in v0.4.1
ListDatabasesQuery returns the SQL to list databases in a server instance.
func ListObjectsQuery ¶ added in v0.4.1
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 ¶ added in v0.4.1
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 ¶ added in v0.4.1
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.