entmixin

package
v0.10.0-rc15 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package entmixin provides reusable Ent schema mixins for the ncps Ent schemas under ent/schema/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timestamps

type Timestamps struct {
	mixin.Schema
}

Timestamps contributes the project-standard `created_at` and `updated_at` columns to any Ent schema that embeds it via `Mixin()`.

  • `created_at` is NOT NULL with DB-level DEFAULT CURRENT_TIMESTAMP, set on insert and never modified afterwards (immutable).
  • `updated_at` is nullable; the application sets it explicitly when a row is modified.

The DB-level DEFAULT on `created_at` is declared via `entsql.Default` so that raw-SQL inserts (notably from migration backfills and test helpers) succeed without specifying the column.

func (Timestamps) Annotations

func (Timestamps) Annotations() []schema.Annotation

Annotations is required for the mixin interface; no schema-wide annotations are needed here because the per-field annotations above are what the dialect codegen reads.

func (Timestamps) Fields

func (Timestamps) Fields() []ent.Field

Fields of the Timestamps mixin.

Jump to

Keyboard shortcuts

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