draft

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package draft reads and checks an app's schema-change draft, .aicoded/migration.sql, for aicoded check.

Index

Constants

View Source
const File = ".aicoded/migration.sql"

File is where an app keeps its draft, relative to its folder.

Variables

This section is empty.

Functions

func Check

func Check(dir string, m manifest.Manifest) (stmts []string, notes []*errs.Error, err error)

Check reads the draft of the app in dir, whose permission list is m, and checks it with migrate.Check. It returns the draft's statements, or nil when the app has none, and the notes of migrate.Notes: E-MIG-003 at the line of each destructive statement. Its error joins every problem, each at the draft's line or at the draft: those of Read and migrate.Check, and E-MIG-006 for a draft of an app that declares no sqldb.

func Read

func Read(dir string) ([]byte, error)

Read returns the draft of the app in dir, or nil when the app has none. It reads the draft only inside dir, and refuses with E-MIG-001 one that is not a regular file, lies outside dir, cannot be read or holds more than 64 KiB.

Types

This section is empty.

Jump to

Keyboard shortcuts

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