'Azure synapse connection with typeORM from nestjs api
I am testing nestjs but i have doubts about how to create a connection to azure synapse to get data from a table, is this possible? i understand that synapse would be mysql type, i am using this orm config but i get this error.
If there is a better way to do this I would appreciate to be told, thank you very much.
"type": "mysql",
"host": "host",
"username": "username",
"password": "password",
"database": "database",
"port": 1433,
"synchronize": true,
"entities": ["src/modules/**/**/*.entity{.ts,.js}"],
"migrations": ["src/database/migrations/*{.ts,.js}"],
"seeds": ["./src/database/seeds/*{.ts,.js}"],
"factories": ["./src/database/factories/*{.ts,.js}"],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/database/migrations"
},
"extra": {
"encrypt": true
}
}
[Nest] 78444 - 09/03/2022 23:11:31 [TypeOrmModule] Unable to connect to the database. Retrying (2)... +9342ms
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
Solution 1:[1]
To resolve this [TypeOrmModule] Unable to connect to the database. Retrying (2)... +9342ms... ECONNRESET error, try either of the following ways:
Check your network settings, e.g. Firewall
Run using specific version of
tls:node --tls-min-v1.0 app.jsCheck the location entities directory, for example:
entities: [__dirname + '/**/entity/*.entity{.ts,.js}'],
You can refer to [TypeOrmModule] Unable to connect to the database. Retrying and NestJs TypeORM unable to connect to mysql
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
