Sync Options

interface SyncOptions {
    alter?: boolean | SyncAlterOptions;
    benchmark?: boolean;
    force?: boolean;
    hooks?: boolean;
    logging?: boolean | ((sql, timing?) => void);
    match?: RegExp;
    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?: boolean | ((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

match?: RegExp

Match a regex against the database name before syncing, a safety check for cases where force: true is used in tests but not live code

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)

Generated using TypeDoc