prorm API Reference
    Preparing search index...

    Function model

    • Generate a model file from model name and fields

      Parameters

      • modelName: string

        The name of the model (e.g., 'User')

      • fields: Record<string, string>

        Object defining fields (e.g., { name: 'STRING', email: 'STRING' })

      • options: {
            tableName?: string;
            timestamps?: boolean;
            paranoid?: boolean;
            primaryKey?: boolean;
            autoIncrement?: boolean;
            allowNull?: boolean;
            unique?: boolean;
            defaultValue?: any;
        } = {}

        Optional model configuration

      Returns string