Help us shape the future of Go! Take the 2026 Go Developer Survey

snapshot

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

Complete migration snapshots

snapshot.Inspect(ctx, db, snapshot.Options{Schemas: []string{"dbo"}}) reads full SQL Server migration definitions without the row or definition limits used by the interactive explorer. Schemas are explicit. The connection must have database VIEW DEFINITION permission so hidden metadata cannot look like absent objects.

Inspection reuses the shared SQL Server catalogue reader for tables, columns, indexes, keys, checks and routines. It also reads column collations, view and trigger definitions, trigger state and module dependencies. The result uses sqlglot's native migration model; this package does not generate or execute migrations.

The current contract targets SQL Server 2016 or newer, including databases at compatibility level 100. Unsupported computed or user-defined columns, storage settings, indexed views, disabled or untrusted constraints, unsupported module session settings, and external or unresolved dependencies cause explicit errors. This prevents a partial catalogue from becoming a destructive desired state.

Default, check or column expressions that depend on other database objects are also blocked: the native table model does not yet carry those dependencies for ordering and selection validation.

Trigger schemas come from sys.objects, while parent and disabled state come from sys.triggers.

go test ./inspect/sql/snapshot -count=1

The tests separate pure catalogue projection from database-driver boundary checks. Live SQL Server execution remains a separate integration gate.

Documentation

Overview

Package snapshot preserves the commons-db API; implementations live in sqlglot-go.

Package snapshot preserves the commons-db API; implementations live in sqlglot-go.

Index

Constants

This section is empty.

Variables

View Source
var Inspect = native.Inspect

Functions

This section is empty.

Types

type Options

type Options = native.Options

type Querier

type Querier = native.Querier

type Result

type Result = native.Result

Jump to

Keyboard shortcuts

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