Skip to content

Commit 9f6f2db

Browse files
closes #203 and closes #205
1 parent 67d720a commit 9f6f2db

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Decorators and some other extras for sequelize (v3 + v4).
1111
- [`@Column` API](#column-api)
1212
- [Usage](#usage)
1313
- [Configuration](#configuration)
14+
- [globs](#globs)
1415
- [Model-path resolving](#model-path-resolving)
1516
- [Model association](#model-association)
1617
- [One-to-many](#one-to-many)
@@ -63,6 +64,8 @@ class Person extends Model<Person> {
6364
```
6465
The model needs to extend the `Model` class and has to be annotated with the `@Table` decorator. All properties that
6566
should appear as a column in the database require the `@Column` annotation.
67+
68+
See more advanced example [here](https://github.com/RobinBuschmann/sequelize-typescript-example).
6669

6770
### `@Table`
6871
The `@Table` annotation can be used without passing any parameters. To specify some more define options, use
@@ -209,6 +212,18 @@ sequelize config or add the required models later on by calling `sequelize.addMo
209212
sequelize.addModels([Person]);
210213
sequelize.addModels(['path/to/models']);
211214
```
215+
### globs
216+
```typescript
217+
import {Sequelize} from 'sequelize-typescript';
218+
219+
const sequelize = new Sequelize({
220+
...
221+
modelPaths: [__dirname + '/**/*.model.ts']
222+
});
223+
// or
224+
sequelize.addModels([__dirname + '/**/*.model.ts']);
225+
```
226+
212227
#### Model-path resolving
213228
When using a path to resolve the required models, either the class has to be exported as default or if not exported
214229
as default, the file should have the same name as the corresponding class:

0 commit comments

Comments
 (0)