introspect

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package introspect reads the live schema of a database into the same structures codegen builds from the Go models, so the two can be compared.

drel's migration differ works from a snapshot of what drel itself generated. A constraint or an index written by hand is absent from that snapshot, so every later migration is planned as though it did not exist. Introspection makes such an object visible: `drel migrate verify` reports it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Schema

func Schema(ctx context.Context, q Querier, dialect string) (codegen.Schema, error)

Schema reads the live schema for the given dialect.

Types

type Querier

type Querier interface {
	Query(ctx context.Context, query string, args ...any) (driver.Rows, error)
}

Querier is the part of driver.Driver introspection needs.

Jump to

Keyboard shortcuts

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