capabilities

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendCapabilities

type BackendCapabilities struct {
	Backend            string                                        `json:"backend"`
	Version            string                                        `json:"version"`
	Database           string                                        `json:"database"`
	CompatibilityLevel *int                                          `json:"compatibilityLevel,omitempty"`
	EngineEdition      *int                                          `json:"engineEdition,omitempty"`
	Edition            string                                        `json:"edition,omitempty"`
	Features           map[BackendCapability]BackendCapabilityStatus `json:"features"`
}

func ProbeBackendCapabilities

func ProbeBackendCapabilities(ctx context.Context, db Queryer, backend string) (BackendCapabilities, error)

func (BackendCapabilities) Fingerprint

func (c BackendCapabilities) Fingerprint() (string, error)

func (BackendCapabilities) Require

func (c BackendCapabilities) Require(capability BackendCapability) error

func (BackendCapabilities) Validate

func (c BackendCapabilities) Validate() error

type BackendCapability

type BackendCapability string
const (
	BackendCapabilityArrayFilters BackendCapability = "arrayFilters"
	// BackendCapabilityTransactionalDDL: DDL can run inside a transaction and roll back.
	BackendCapabilityTransactionalDDL BackendCapability = "transactionalDDL"
	// BackendCapabilityOnlineIndex: an index can be built without blocking writers.
	BackendCapabilityOnlineIndex BackendCapability = "onlineIndex"
	// BackendCapabilityDataCompression: row/page data compression can be applied to tables and indexes.
	BackendCapabilityDataCompression BackendCapability = "dataCompression"
	// BackendCapabilityTryConvert: TRY_CONVERT is available to SQL in this database.
	BackendCapabilityTryConvert BackendCapability = "tryConvert"
	// BackendCapabilityCreateOrAlter: CREATE OR ALTER is available for routines and views.
	BackendCapabilityCreateOrAlter BackendCapability = "createOrAlter"
	// BackendCapabilityDropIfExists: DROP ... IF EXISTS is available.
	BackendCapabilityDropIfExists BackendCapability = "dropIfExists"
	// BackendCapabilityTableRebuildRequired: altering a column requires rebuilding the table.
	BackendCapabilityTableRebuildRequired BackendCapability = "tableRebuildRequired"
)

type BackendCapabilityStatus

type BackendCapabilityStatus struct {
	Supported                 bool   `json:"supported"`
	Detail                    string `json:"detail,omitempty"`
	MinimumVersion            string `json:"minimumVersion,omitempty"`
	MinimumCompatibilityLevel *int   `json:"minimumCompatibilityLevel,omitempty"`
}

type Queryer added in v1.3.8

type Queryer interface {
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

Queryer is what a probe reads through; *sql.DB, *sql.Conn and *sql.Tx satisfy it.

Jump to

Keyboard shortcuts

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