schemakit

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package schemakit - the engine's conventions for ent schemas, shared by the core's schema and a module's own (its ent/schema): the same table options and column types, so a module's tables look as the core's do.

Index

Constants

This section is empty.

Variables

View Source
var ErrEntityNotFound = entity.ErrEntityNotFound

ErrEntityNotFound - what a missing record is to the engine (modulekit.ErrEntityNotFound): a module's generated ent package makes its NotFoundError match it with a hand-written Is method, as the core's does, so the handlers answer 404 for it.

Functions

func FixedChar

func FixedChar(n int) map[string]string

FixedChar - CHAR(n) on every database.

func MySQLType

func MySQLType(t string) map[string]string

MySQLType - a column type for MySQL only; other databases (PostgreSQL) take ent's default for the field.

func NotIncremental

func NotIncremental() *entsql.Annotation

NotIncremental - an id set by the code (a settings table's single row), not by auto-increment.

func Table

func Table(name string) entsql.Annotation

Table - a table's annotation: its name, and on MySQL utf8mb4 with case-insensitive comparison (utf8mb4_unicode_ci, as the site databases have it) instead of ent's default utf8mb4_bin, under which equality and LIKE would tell the case apart. PostgreSQL ignores both.

Types

This section is empty.

Jump to

Keyboard shortcuts

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