The Easiest Way to Securely Query Postgres in Node.js
See the original posting on DZone Python
When youre querying Postgres, you need to choose between:
- Using an ORM. This gives you native feeling APIs to query the database.
- Using raw SQL. This gives you the ultimate flexibility and performance and gives you more transferable skills. Its always helpful to know how to write SQL.
If you want to use an ORM to query Postgres, I recommend using https://typeorm.io. If youre starting with a fresh project, you can use their
typeorm init CLI command: