Sync Options

interface SyncOptions {
    alter?: boolean | SyncAlterOptions;
    benchmark?: boolean;
    force?: boolean;
    hooks?: boolean;
    logging?: false | ((sql, timing?) => void);
    schema?: string;
    searchPath?: string;
}

Hierarchy (view full)

Properties

alter?: boolean | SyncAlterOptions

If alter is true, each DAO will do ALTER TABLE ... CHANGE ... Alters tables to fit models. Provide an object for additional configuration. Not recommended for production use. If not further configured deletes data in columns that were removed or had their type changed in the model.

benchmark?: boolean

Pass query execution time in milliseconds as second argument to logging function (options.logging).

force?: boolean

If force is true, each DAO will do DROP TABLE IF EXISTS ..., before it tries to create its own table

hooks?: boolean

If false the applicable hooks will not be called. The default value depends on the context.

Default

true
logging?: false | ((sql, timing?) => void)

A function that gets executed while running the query to log the sql.

Type declaration

    • (sql, timing?): void
    • Parameters

      • sql: string
      • Optional timing: number

      Returns void

schema?: string

The schema that the tables should be created in. This can be overridden for each table in sequelize.define

searchPath?: string

An optional parameter to specify the schema search_path (Postgres only)