#Simple database

1 messages · Page 1 of 1 (latest)

hybrid cargo
#

TypeORM is an Object Relation Mapper (ORM) that can handle several different database types (mysql, postgres, mssql, sqlite, etc). You could do that single table through it if you wanted to.

Seems like really you just need a simple database connection though, yeah? I'd make a custom provider for the connection object and inject the connection where it is necessary

#

Then you can do raw SQL queries where the connection is injected

stark forge
#

ORMs get things done right quickly at low cost

#

I find Sequelize easier to use than TypeORM but both are good and nicely supported by Nest

hybrid cargo
# stark forge If I may raw SQL queries can easily become a burden even on simple projects

Can be. It really just all depends on what's being ran and written. I've personally really liked using kysely as a query builder, good Typescript support and a nice API to work with, but no hassle of setting up entities based on classes. A simple interface suffices and I can be on my way (plus I stop thinking that the ClassSerializerInterceptor is gonna do things for me cause I know I have to turn it into a class based on the result first 🙂

stark forge
#

do you happen to know if there is a performance difference (even at small scale)?

stark forge
#

say TypeORM