{

Learn free typeorm tutorials


Typeorm - Cannot use import statement outside a module

December 1, 2022 ·  2 min read

IN NestJS application, Created an Custom Entity and corresponding Controller, Service and started an application, got an below error during startup. TypeORM Entity in NESTJS - Cannot use import statement outside a module import { Entity, Column, PrimaryGeneratedColumn } from ‘typeorm’; ^^^^^^ SyntaxError: Cannot use import statement outside a module at wrapSafe (internal/modules/cjs/loader.js:984:16) at Module._compile (internal/modules/cjs/loader.js:1032:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14) at Module.require (internal/modules/cjs/loader.js:957:19) at require (internal/modules/cjs/helpers....


Typeorm - Connection Pool configuration MySQL and Postgres

December 1, 2022 ·  2 min read

This tutorial explains how to define a connection pool in the TypeOrm NodeJS application. Connection pools are pre-created pools of connections used in NestJS or javascript applications to Connect to a Database. Connection is an HTTP Connection used to connect to the Database to do DB operations. Connection is required for each operation, examples of operations are Create, Update, Delete Read. To configure the database with typeorm, the Following configuration is required for the MySQL database....


Typeorm - Fix for MissingDriverError: Wrong driver: undefined in NestJS application

December 1, 2022 ·  2 min read

In the NestJS application, Configured the Mysql database with the TypeOrm framework and got an issue while starting the Nestjs app using the npm run start command. [Nest] 12964 - 23/10/2022, 12:26:06 pm ERROR [TypeOrmModule] Unable to connect to the database. Retrying (5)… MissingDriverError: Wrong driver: “undefined” given. Supported drivers are: “aurora-mysql”, “aurora-postgres”, “better-sqlite3”, “capacitor”, “cockroachdb”, “cordova”, “expo”, “mariadb”, “mongodb”, “mssql”, “mysql”, “nativescript”, “oracle”, “postgres”, “react-native”, “sap”, “sqlite”, “sqljs”, “spanner”. at DriverFactory....


Subscribe
You'll get a notification every time a post gets published here.