database

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func ListDatabaseSizesQuery(dbType config.DBType) string

ListDatabaseSizesQuery returns the SQL to list databases with their estimated sizes.

func ListDatabasesQuery

func ListDatabasesQuery(dbType config.DBType) string

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

func ListTablesQuery(dbType config.DBType) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL