Versions in this module Expand all Collapse all v0 v0.8.1 Nov 8, 2026 v0.8.0 Nov 8, 2026 v0.7.2 Nov 1, 2026 v0.7.1 Nov 1, 2026 v0.7.0 Oct 25, 2026 Changes in this version + const MaxDecimalPrecision + func NormalizeDecimal(s string, precision, scale int) (string, bool) type Column + Scale int type ColumnKind + const ColumnDecimal type Field + Precision int + Scale int + func (f *Field) Decimal() bool v0.6.0 Oct 24, 2026 Changes in this version type Entity + func (e *Entity) ScopeOwner() *Field + func (e *Entity) ScopeRef() *Field v0.5.0 Oct 24, 2026 Changes in this version + const IdempotencyLocationSize + const IdempotencyTable v0.4.0 Oct 23, 2026 Changes in this version + const RateLimitsTable v0.3.0 Oct 23, 2026 v0.2.0 Oct 19, 2026 Changes in this version + const APIKeysTable + const DeletedAtColumn + const KeyNameSize + const KeyPrefixSize + const MaxIdentifierLength + const PasswordSize + const RefreshTokensTable + const SessionsTable + const SharedDatabase + const SnapshotVersion + const TokenHashSize + const TokenIDSize + var AllOperations = []Operation + var AuthTables = []string + var Methods = []Method + func AuthUserColumn(e *Entity) string + func BuildDatabases(m *Model) map[string]*Database + func ColumnSize(f *Field) int + func ConstraintName(prefix string, parts ...string) string + func JoinColumn(e *Entity) string + func JoinPair(a, b *Entity) (*Entity, *Entity) + func MigrationName(oldDB *Database, changes []Change) string + func RelationPolicies(source, target *Entity) (list Policy, link Policy, ok bool) + func SameDatabase(a, b *Entity) bool + type Change struct + Check *Check + Column *Column + ForeignKey *ForeignKey + Index *Index + InlineFKs []*ForeignKey + Kind ChangeKind + NewTable bool + OldColumn *Column + Table *Table + TableName string + func Inverse(c Change) Change + type ChangeKind string + const ChangeAddCheck + const ChangeAddColumn + const ChangeAddForeignKey + const ChangeAddIndex + const ChangeAlterColumn + const ChangeCreateTable + const ChangeDropCheck + const ChangeDropColumn + const ChangeDropForeignKey + const ChangeDropIndex + const ChangeDropTable + type Check struct + Column string + Name string + Values []string + type Column struct + Default *Default + Identity bool + Kind ColumnKind + Name string + Nullable bool + Size int + func FieldColumn(f *Field) *Column + type ColumnKind string + const ColumnBool + const ColumnBytes + const ColumnFloat32 + const ColumnFloat64 + const ColumnInt16 + const ColumnInt32 + const ColumnInt64 + const ColumnString + const ColumnTime + const ColumnUUID + type Database struct + Tables []*Table + func Build(m *Model) *Database + func (d *Database) Table(name string) *Table + type DatabaseMode string + const DatabaseOwn + const DatabaseShared + type Default struct + Kind DefaultKind + Value string + type DefaultKind string + const DefaultLiteral + const DefaultNow + type Diagnostic struct + Code string + Message string + Severity Severity + Suggestion string + func (d Diagnostic) String() string + type Diagnostics []Diagnostic + func (ds Diagnostics) Error() string + func (ds Diagnostics) Errors() Diagnostics + func (ds Diagnostics) HasErrors() bool + func (ds Diagnostics) Sort() + func (ds Diagnostics) Warnings() Diagnostics + type DiffOptions struct + RecreateDependents bool + type DiffResult struct + Changes []Change + Warnings []string + func Diff(oldDB, newDB *Database, opts DiffOptions) DiffResult + func (r DiffResult) Down() []Change + func (r DiffResult) Empty() bool + type Entity struct + Auth []Method + Domain string + Fields []*Field + File string + Name string + NoRoutes bool + Pos Pos + Public Operations + ReadOnly bool + Register bool + Relations []*Relation + Roles []string + Service *Service + SoftDelete bool + Table string + UUIDImport string + WriteRoles []string + func (e *Entity) AutoCreateField() *Field + func (e *Entity) BelongsTo() []*Field + func (e *Entity) CreateFields() []*Field + func (e *Entity) DatabaseName() string + func (e *Entity) Field(name string) *Field + func (e *Entity) FieldNames() []string + func (e *Entity) FilterFields() []*Field + func (e *Entity) HasMethod(m Method) bool + func (e *Entity) Identity() *Field + func (e *Entity) IsAuth() bool + func (e *Entity) LoginMethod() Method + func (e *Entity) Owner() *Field + func (e *Entity) PK() *Field + func (e *Entity) Password() *Field + func (e *Entity) Path() string + func (e *Entity) PathParam() string + func (e *Entity) Policy(op Operation) Policy + func (e *Entity) Role() *Field + func (e *Entity) UniqueFields() []*Field + func (e *Entity) UpdateFields() []*Field + func (e *Entity) Var() string + type Field struct + AutoCreate bool + AutoPK bool + AutoUpdate bool + Column string + Default string + Email bool + Enum []string + HasDefault bool + Identity bool + Index bool + JSON string + Kind Kind + Max string + Min string + Name string + NotEmpty bool + Nullable bool + OmitCreate bool + OmitResponse bool + OmitUpdate bool + Owner bool + PK bool + Password bool + Pos Pos + Ref *Reference + Required bool + Role bool + Unique bool + func (f *Field) Auto() bool + func (f *Field) CrossService(owner *Entity) bool + func (f *Field) External(owner *Entity) bool + func (f *Field) Filterable() bool + func (f *Field) GoType() string + func (f *Field) InCreate() bool + func (f *Field) InUpdate() bool + func (f *Field) InputJSON() string + func (f *Field) InputName() string + type ForeignKey struct + Columns []string + Name string + OnDelete OnDelete + RefColumns []string + RefTable string + type Index struct + Columns []string + Name string + NotDeleted bool + Unique bool + type Kind int + const KindBool + const KindBytes + const KindFloat32 + const KindFloat64 + const KindInt + const KindInt16 + const KindInt32 + const KindInt64 + const KindString + const KindTime + const KindUUID + func (k Kind) BitSize() int + func (k Kind) ColumnKind() ColumnKind + func (k Kind) GoType() string + func (k Kind) IsFloat() bool + func (k Kind) IsInteger() bool + func (k Kind) IsNumeric() bool + func (k Kind) String() string + type Method string + const MethodAPIKey + const MethodJWT + const MethodSession + type Model struct + Entities []*Entity + Services []*Service + func (m *Model) AuthEntity() *Entity + func (m *Model) Entity(name string) *Entity + func (m *Model) EntityNames() []string + func (m *Model) Service(name string) *Service + func (m *Model) Workspace() bool + type OnDelete string + const OnDeleteCascade + const OnDeleteRestrict + const OnDeleteSetNull + type Operation string + const OpCreate + const OpDelete + const OpRead + const OpUpdate + type Operations struct + Create bool + Delete bool + Read bool + Update bool + func (o *Operations) Set(op Operation) + func (o Operations) Any() bool + func (o Operations) Has(op Operation) bool + type Policy struct + Public bool + Roles []string + func Combine(a, b Policy) (Policy, bool) + type Pos struct + Column int + File string + Line int + func (p Pos) IsValid() bool + func (p Pos) String() string + type PrimaryKey struct + Columns []string + Name string + type Reference struct + Entity string + OnDelete OnDelete + Target *Entity + type Relation struct + FK string + Kind RelationKind + Name string + Pos Pos + Target string + Via string + func (r *Relation) PathSegment() string + type RelationKind string + const RelationHasMany + const RelationManyToMany + type Service struct + Database DatabaseMode + Entities []*Entity + File string + Name string + Pos Pos + TypeName string + func (s *Service) DatabaseName() string + type Severity string + const SeverityError + const SeverityWarning + type Snapshot struct + Dialect string + Migrations []string + Tables []*Table + Version int + func NewSnapshot(dialect string, db *Database, migrations []string) *Snapshot + func UnmarshalSnapshot(data []byte) (*Snapshot, error) + func (s *Snapshot) Database() *Database + func (s *Snapshot) Marshal() ([]byte, error) + type Table struct + Checks []*Check + Columns []*Column + ForeignKeys []*ForeignKey + Indexes []*Index + Name string + PrimaryKey *PrimaryKey + func (t *Table) Check(name string) *Check + func (t *Table) Column(name string) *Column + func (t *Table) ForeignKey(name string) *ForeignKey + func (t *Table) Index(name string) *Index