mssql

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MSSQLQueryLogSchema added in v0.12.0

type MSSQLQueryLogSchema struct {
	Database             string     `db:"database"`
	QueryId              int64      `db:"query_id"`
	QueryHash            *int64     `db:"query_hash"`
	QuerySqlText         *string    `db:"query_sql_text"`
	ExecutionType        int        `db:"execution_type"`
	CountExecutions      int64      `db:"count_executions"`
	FirstExecutionTime   *time.Time `db:"first_execution_time"`
	LastExecutionTime    *time.Time `db:"last_execution_time"`
	AvgDurationUs        *float64   `db:"avg_duration_us"`
	LastDurationUs       *float64   `db:"last_duration_us"`
	AvgCpuTimeUs         *float64   `db:"avg_cpu_time_us"`
	AvgLogicalIoReads    *float64   `db:"avg_logical_io_reads"`
	AvgLogicalIoWrites   *float64   `db:"avg_logical_io_writes"`
	AvgPhysicalIoReads   *float64   `db:"avg_physical_io_reads"`
	AvgRowcount          *float64   `db:"avg_rowcount"`
	AvgQueryMaxUsedMemKb *float64   `db:"avg_query_max_used_memory_kb"`
	PlanId               int64      `db:"plan_id"`
	IntervalStart        *time.Time `db:"interval_start"`
	IntervalEnd          *time.Time `db:"interval_end"`
}

MSSQLQueryLogSchema maps columns from the Query Store runtime stats query. Query Store aggregates execution statistics per plan per time interval, so each row represents a plan's stats during one interval (not a single execution).

type MSSQLScrapper

type MSSQLScrapper struct {
	// contains filtered or unexported fields
}

func NewMSSQLScrapper

func NewMSSQLScrapper(ctx context.Context, conf *MSSQLScrapperConf) (*MSSQLScrapper, error)

func (*MSSQLScrapper) Capabilities added in v0.10.6

func (e *MSSQLScrapper) Capabilities() scrapper.Capabilities

func (*MSSQLScrapper) Close

func (e *MSSQLScrapper) Close() error

func (*MSSQLScrapper) DialectType

func (e *MSSQLScrapper) DialectType() string

func (*MSSQLScrapper) Executor added in v0.12.0

func (e *MSSQLScrapper) Executor() *dwhexecmssql.MSSQLExecutor

func (*MSSQLScrapper) FetchQueryLogs added in v0.12.0

func (s *MSSQLScrapper) FetchQueryLogs(
	ctx context.Context,
	from, to time.Time,
	obfuscator querylogs.QueryObfuscator,
) (querylogs.QueryLogIterator, error)

func (*MSSQLScrapper) IsPermissionError

func (e *MSSQLScrapper) IsPermissionError(err error) bool

func (*MSSQLScrapper) QueryCatalog

func (e *MSSQLScrapper) QueryCatalog(ctx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*MSSQLScrapper) QueryCustomMetrics

func (e *MSSQLScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*MSSQLScrapper) QueryDatabases

func (e *MSSQLScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*MSSQLScrapper) QuerySegments

func (e *MSSQLScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*MSSQLScrapper) QueryShape

func (e *MSSQLScrapper) QueryShape(ctx context.Context, sql string) ([]*scrapper.QueryShapeColumn, error)

func (*MSSQLScrapper) QuerySqlDefinitions

func (e *MSSQLScrapper) QuerySqlDefinitions(ctx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*MSSQLScrapper) QueryTableConstraints

func (e *MSSQLScrapper) QueryTableConstraints(ctx context.Context) ([]*scrapper.TableConstraintRow, error)

func (*MSSQLScrapper) QueryTableMetrics

func (e *MSSQLScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*MSSQLScrapper) QueryTables

func (e *MSSQLScrapper) QueryTables(ctx context.Context, opts ...scrapper.QueryTablesOption) ([]*scrapper.TableRow, error)

func (*MSSQLScrapper) SqlDialect

func (e *MSSQLScrapper) SqlDialect() sqldialect.Dialect

func (*MSSQLScrapper) ValidateConfiguration

func (e *MSSQLScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)

type MSSQLScrapperConf

type MSSQLScrapperConf struct {
	dwhexecmssql.MSSQLConf
}

Jump to

Keyboard shortcuts

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