Skip to content

Commit 61bef8b

Browse files
Update sql-typeorm.md
1 parent b2a788e commit 61bef8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/recipes/sql-typeorm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To start the adventure with this library we have to install all required depende
1414
$ npm install --save typeorm mysql2
1515
```
1616

17-
The first step we need to do is to establish the connection with our database using `createConnection()` function imported from the `typeorm` package. The `createConnection()` function returns a `Promise`, and therefore we have to create an [async provider](/fundamentals/async-components).
17+
The first step we need to do is to establish the connection with our database using `new DataSource().initialize()` class imported from the `typeorm` package. The `initialize()` function returns a `Promise`, and therefore we have to create an [async provider](/fundamentals/async-components).
1818

1919
```typescript
2020
@@filename(database.providers)
@@ -61,7 +61,7 @@ import { databaseProviders } from './database.providers';
6161
export class DatabaseModule {}
6262
```
6363

64-
Now we can inject the `Connection` object using `@Inject()` decorator. Each class that would depend on the `Connection` async provider will wait until a `Promise` is resolved.
64+
Now we can inject the `DATA_SOURCE` object using `@Inject()` decorator. Each class that would depend on the `DATA_SOURCE` async provider will wait until a `Promise` is resolved.
6565

6666
#### Repository pattern
6767

0 commit comments

Comments
 (0)