How to Add Knex to ExpressJS Apps and Connect to a Postgres Database

Written by mandeep_m91 | Published 2021/01/21
Tech Story Tags: expressjs | postgres | knex | databases | programming | node | coding | express

TLDR How to Add Knex to ExpressJS Apps and Connect to a Postgres database? How do we use it to connect our ExpressJS app and how do we connect our postgres database to our Express app? Knex and Sequelize provide a very neat API for writing queries which are database agnostic and prevent issues like SQL injection attacks. These libraries provide transaction support to handle complex DB operations and streaming API to handle large volumes of data in a script. Knex creates a few extra tables which contain information about what all migrations have been applied.via the TL;DR App

no story

Written by mandeep_m91 | Learning tech by building stuff
Published by HackerNoon on 2021/01/21