source

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

internal/source/source.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int
const (
	KindQuery Kind = iota
	KindMigrationUp
	KindSchema
)

type Unit

type Unit struct {
	Path    string
	SQL     string
	DownSQL string // migrations only; empty when no -- sqld:down section
	Kind    Kind
	Version string // migrations only
}

Unit is one SQL chunk with provenance.

func Resolve

func Resolve(cfg *config.Config) ([]Unit, error)

Resolve reads all schema, query, and migration sources into ordered units. Declarative schema sources (KindSchema) come from cfg.Schema. Named queries come from cfg.Queries (KindQuery). Migration files come from cfg.Migrations (KindMigrationUp).

Jump to

Keyboard shortcuts

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