schema

package
v0.0.0-...-1f8c1e5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 6 Imported by: 3

Documentation

Overview

Package schema contains the schema definitions for all the domains. The schema is broken down into a controller (global) namespace and a set of model namespaces. Each domain package wraps a set of workflows that can affect either the controller or model namespaces. It's generally a good idea not to mix the two, because of a lack atomicity across two different databases (even if attempting to use ATTACH DATABASE in SQLite) can cause inconsistencies or additional complexity.

The schema is a set of DDL SQL statements for controller and models. They're independent from each other. Each set of schema is executed in a single transaction, and any error will cause the transaction to be rolled back.

Schema triggers are a set of SQL trigger statements that are executed after a row is inserted, updated, or deleted. They're used to drive the watchers and the change stream in a generic way. All triggers should be first implemented as generic generated triggers, unless there's a good reason to implement them as a logical custom trigger.

There are parts of the schema that should never be updated in a patch/build release. The provider tracker requires that the underlying schema is never changed. Changing the schema will lead to undefined behavior and data loss.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControllerDDL

func ControllerDDL() *schema.Schema

ControllerDDL is used to create the controller database schema at bootstrap.

func ModelDDL

func ModelDDL() *schema.Schema

ModelDDL is used to create model databases.

Types

This section is empty.

Directories

Path Synopsis
controller
model

Jump to

Keyboard shortcuts

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