So recently, I need to use Azure Cosmos DB with their Core SQL API as my data persistence layer for my NestJS application. I looked around NestJS documentation, and the ORM we can use for NestJS (TypeORM, Mongoose, Sequelize, and Prisma) only support either PostgreSQL, MySQL/MariaDB, MongoDB, and other database engines, but not Cosmos DB SQL API.
Thanks to the beauty of open-source software, usually within a 30 minutes search, I would find a module that would satisfy my needs. So, I searched far and wide and found @nest/azure-database.
I tried it and asked a question on Stackoverflow on using the module for my use case, and finally, I decided that at its current state, I am not confident enough to use it in my application.
To quote the explanation from the docs:
… dynamic modules provide an API for importing one module into another, and customizing the properties and behavior of that module when it is imported, as opposed to using the static bindings we've seen so far.
Also, there are two sample implementations you can refer to by Jay McDoniel where the author is using dynamic module with NodeJS pg module and apparently in NestJS sample directory where the sample is using NodeJS Mongoose module without using the NestJS' version.
So, for now, I will see if I can utilize NestJS' dynamic module for my use case and will share my sample implementation in my future post.