scan

package
v0.7.0 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: 14 Imported by: 0

Documentation

Overview

Package scan runs a read-only scan of one database. It reads the schema, samples rows, judges every column and meta key, works out how tables link up, and lists what a plain copy would let staging do to real people.

Index

Constants

View Source
const (
	DefaultSampleRows     = 300
	DefaultMetaSampleRows = 3000
	DefaultKeySampleRows  = 20
	DefaultMaxValueLen    = 4096
)

Defaults for Options.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, sess *dbconn.Session, opts Options) (*model.Result, error)

Run scans the database behind the session.

Types

type Options

type Options struct {
	SampleRows     int  // rows per table
	MetaSampleRows int  // rows per key/value table too big to read whole
	KeySampleRows  int  // rows per key of a key/value table
	Samples        bool // false judges names only and reads no rows
	// SampleKeysOnly reads every key/value table by sampling, as for tables
	// too large to list their keys: a window of rows plus probes for the
	// keys presets know.
	SampleKeysOnly bool
	Preset         string
	MaxValueLen    int
	Version        string
	Progress       func(done, total int, table string)
}

Options control a scan.

Jump to

Keyboard shortcuts

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