AutoBE
    Preparing search index...

    A single Prisma model (database table).

    interface IModel {
        description: string;
        foreignFields: IForeignField[];
        ginIndexes: IGinIndex[];
        material: boolean;
        name: string & SnakeCasePattern;
        plainFields: IPlainField[];
        plainIndexes: IPlainIndex[];
        primaryField: IPrimaryField;
        stance: "primary" | "subsidiary" | "snapshot" | "actor" | "session";
        uniqueIndexes: IUniqueIndex[];
    }
    Index

    Properties

    description: string

    Business purpose of this model.

    Format: summary sentence first, \n\n, then paragraphs grouped by topic. Use {@\link ModelName} for cross-references.

    MUST be written in English.

    foreignFields: IForeignField[]

    Foreign key fields establishing relationships to other models.

    ginIndexes: IGinIndex[]

    GIN indexes for PostgreSQL full-text search (trigram).

    material: boolean

    Whether this model is a materialized view (read-only cached query). If true, name must use "mv_" prefix.

    name: string & SnakeCasePattern

    MUST use snake_case. Materialized views use "mv_" prefix.

    plainFields: IPlainField[]

    Regular data fields (names, timestamps, flags, amounts, etc.).

    plainIndexes: IPlainIndex[]

    Regular indexes for query performance.

    primaryField: IPrimaryField

    Primary key field (UUID).

    stance: "primary" | "subsidiary" | "snapshot" | "actor" | "session"

    Architectural role of this model, guiding API endpoint generation.

    • "primary": Core entity users manage independently (full CRUD APIs). Use when users need to create, search, or manage entities outside their parent context.
    • "actor": Authenticated user type with its own identity, credentials, and auth flow. Generates auth endpoints.
    • "session": Login session table belonging to exactly one actor. Append-only audit trail, managed via auth flows.
    • "subsidiary": Supporting entity managed through its parent, rarely needs standalone endpoints.
    • "snapshot": Point-in-time versioning record, typically append-only and read-only from user perspective.
    uniqueIndexes: IUniqueIndex[]

    Unique indexes for data integrity constraints.