prorm API Reference
    Preparing search index...

    Interface Includeable

    An association to eager-load, given as the model, its alias, or a full IncludeOptions.

    interface Includeable {
        model: ModelStatic<any>;
        as?: string;
    }

    Hierarchy (View Summary)

    Index
    model: ModelStatic<any>

    The model to include

    as?: string

    Alias for the included model. Used as:

    • The key in result objects (e.g., user.myPosts instead of user.Posts)
    • The base name for association methods (e.g., user.getMyPosts(), user.setMyPosts())
    • The table alias in SQL JOINs
    // With 'as' alias
    User.findAll({
    include: [{ model: Post, as: 'myPosts' }]
    })
    // Result: { id: 1, name: 'John', myPosts: [...] }

    // Without 'as' - defaults to model name
    User.findAll({
    include: [{ model: Post }]
    })
    // Result: { id: 1, name: 'John', Posts: [...] }