discovery

package
v3.18.28 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const QueryTimeout = 5 * time.Second

Variables

This section is empty.

Functions

func ApproxRowCount

func ApproxRowCount(ctx context.Context, db *sql.DB, dbtype string, schema *core.TableSchema) (int64, bool)

ApproxRowCount returns a single-table reltuples-equivalent lookup.

func NamespaceForSingleTier

func NamespaceForSingleTier(database, schema string) string

NamespaceForSingleTier returns the namespace for mysql/mariadb where database == schema.

func RowCountsForNamespace

func RowCountsForNamespace(ctx context.Context, gj *core.GraphJin, database, schema string) (map[string]int64, error)

RowCountsForNamespace returns counts for every table in one namespace with one catalog query.

Types

type Capabilities

type Capabilities struct {
	BatchSchemaMetadata            bool
	BatchRowCounts                 bool
	AsyncRowCountWarmup            bool
	ConstraintPreflight            bool
	ExactPerTableRowCountByDefault bool
}

Capabilities describes the discovery shape a database can support.

func CapabilitiesFor

func CapabilitiesFor(gj *core.GraphJin, database string) Capabilities

CapabilitiesFor returns the internal discovery capability model for a database.

func DefaultCapabilities

func DefaultCapabilities() Capabilities

DefaultCapabilities returns the conservative discovery contract used when a database type cannot be resolved.

type NamespaceRollup

type NamespaceRollup struct {
	Database          string `json:"database"`
	Schema            string `json:"schema,omitempty"`
	TableCount        int    `json:"table_count"`
	ApproxRowTotal    int64  `json:"approx_row_total"`
	RowCountAvailable bool   `json:"row_count_available"`
}

NamespaceRollup summarizes one database/schema namespace.

func Namespaces

func Namespaces(ctx context.Context, gj *core.GraphJin, database string) ([]NamespaceRollup, error)

Namespaces returns one catalog rollup per (database, schema).

Jump to

Keyboard shortcuts

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