schema

package
v0.1.0-rc.39 Latest Latest
Warning

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

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

Documentation

Overview

Package schema is `w17ctl schema` — the authoring-time half of the DEV schema path.

The split it serves: planning a schema change is a compiler concern and happens on the console; applying it needs the database, so the binary that owns one does that. Between them sits every environment where neither holds at once — a compose stack whose Postgres appears seconds before the services do, a CI job, a fresh checkout. There the console ran at BUILD time and is gone by the time the database exists.

So the plan is written down, exactly as a rendered fixture is, and the generated binary executes it with `<binary> schema apply`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Render RenderCmd `` /* 318-byte string literal not displayed */
}

Cmd is the `w17ctl schema` parent.

type RenderCmd

type RenderCmd struct {
	Protos  []string `` /* 207-byte string literal not displayed */
	Imports []string `name:"import" short:"I" placeholder:"DIR" help:"Additional proto import path. Repeatable."`
	Out     string   `` /* 154-byte string literal not displayed */
	Console string   `` /* 213-byte string literal not displayed */
}

RenderCmd writes the full-create dev plan for the project's current models.

From EMPTY state, deliberately: this artefact is what a database that does not exist yet is built from, and the dev path RECONCILES rather than walks a history — the planner diffs what the models say against what the store holds, so a plan built from empty applies cleanly to an empty store and is re-rendered whole whenever the models change. That is the same thing `db/init/<domain>/01_schema.sql` was, and it is generated by the same planner; what changes is that a step in the stack runs it every time the stack comes up, instead of the postgres entrypoint running it only on a volume that has never existed before.

func (*RenderCmd) Run

func (c *RenderCmd) Run() error

Jump to

Keyboard shortcuts

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