mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Sequelize Add documented props to SyncOptions (#16976)
* Added alter, hooks, and searchPath to syncOptions interface with compiler test and documentation comments (straight from sequelize v4 docs) * Fix implicit any return type error
This commit is contained in:
committed by
Mohamed Hegazy
parent
ae77e5216b
commit
b860983357
20
types/sequelize/index.d.ts
vendored
20
types/sequelize/index.d.ts
vendored
@@ -3165,7 +3165,7 @@ declare namespace sequelize {
|
||||
* Load further nested related models
|
||||
*/
|
||||
include?: Array<Model<any, any> | IncludeOptions>;
|
||||
|
||||
|
||||
/**
|
||||
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will
|
||||
* be returned. Only applies if `options.paranoid` is true for the model.
|
||||
@@ -3260,7 +3260,7 @@ declare namespace sequelize {
|
||||
* Apply DISTINCT(col) for FindAndCount(all)
|
||||
*/
|
||||
distinct?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Prevents a subquery on the main table when using include
|
||||
*/
|
||||
@@ -5052,6 +5052,22 @@ declare namespace sequelize {
|
||||
*/
|
||||
schema?: string;
|
||||
|
||||
/**
|
||||
* Alters tables to fit models. Not recommended for production use. Deletes data in columns
|
||||
* that were removed or had their type changed in the model.
|
||||
*/
|
||||
alter?: boolean;
|
||||
|
||||
/**
|
||||
* If hooks is true then beforeSync, afterSync, beforBulkSync, afterBulkSync hooks will be called
|
||||
*/
|
||||
hooks?: boolean;
|
||||
|
||||
/**
|
||||
* An optional parameter to specify the schema search_path (Postgres only)
|
||||
*/
|
||||
searchPath?: string;
|
||||
|
||||
}
|
||||
|
||||
interface SetOptions { }
|
||||
|
||||
@@ -1670,3 +1670,14 @@ s.transaction((): Q.Promise<void> => {
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
|
||||
// sync options types
|
||||
s.sync({
|
||||
alter: true,
|
||||
force: true,
|
||||
hooks: false,
|
||||
searchPath: 'some/path/',
|
||||
schema: 'schema',
|
||||
logging: () => {},
|
||||
match: new RegExp('\d{4,}')
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user