prorm API Reference
    Preparing search index...

    Interface SyncOptions

    Options for sync method

    interface SyncOptions {
        force?: boolean;
        alter?: boolean | { drop?: boolean };
        match?: RegExp;
        logging?: boolean | ((sql: string, timing?: number) => void);
        hooks?: boolean;
        indexes?: boolean;
        constraints?: boolean;
    }
    Index
    force?: boolean

    If true, drops all tables and recreates them. WARNING: This will destroy all data in the tables!

    false
    
    alter?: boolean | { drop?: boolean }

    If true, alter tables to match model definitions. This will add new columns, remove extra columns, and change column types as needed. Preserves existing data in the table. Can be an object with { drop: false } to prevent dropping columns

    false
    
    match?: RegExp

    Regular expression to match the database name. Sync will only proceed if the database name matches this pattern. Useful for development vs production environments. Example: /test/ - only syncs if database name contains "test"

    logging?: boolean | ((sql: string, timing?: number) => void)

    Custom logging function

    hooks?: boolean

    If true, run sync hooks (beforeSync, afterSync, etc.)

    true
    
    indexes?: boolean

    If true, also sync indexes

    true
    
    constraints?: boolean

    If true, also sync foreign key constraints

    true