Home > Software design >  Do I need to Implement Controller with PostgreSql
Do I need to Implement Controller with PostgreSql

Time:03-30

I'm working on a project and want to achieve a clean coding, but I'm a bit confused about controllers, from research its seems like they are most likely used while working with a NoSql databases that requires model, to cut it short I'm working with PostgreSql do I need to implement that or do i have to stick with the routes, any suggestion is appreciated.

Thanks in Advance.

CodePudding user response:

Turns out I can create a model even though I'm not using a NoSql database. This solved my issue.

CodePudding user response:

Actually, the controllers are functions/methods that are used to handle the logic of the routes. About models, they're a way to abstract the entities that you have on your application and how they'll be structured on your database (be it SQL or NoSQL). And you can always use libraries (ORMs, QueryBuilders) that abstract the way that you deal with databases, for SQL databases I personally use on my projects TypeORM (for large project Knex (for simple ones). :)

  • Related