1

I have a script to create a database for a project I'm working on. In this project don't have been using any ORM, just plain text for the query creation, using a pg-node module to do this. I would know if it's possible to execute all SQL for the database transactions. For example:

db_create.sql, this script has all tables to create. How to run a command like

npm run serve, npm run test, or whatever other to start an automatic process, in this case, to create a DB or any other database process I will wish.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • 1
    If I understood correctly what you need, then try to read these articles. [Executing Shell Commands](https://stackabuse.com/executing-shell-commands-with-node-js/) and [Executing Shell Commands](https://stackoverflow.com/questions/20643470/execute-a-command-line-binary-with-node-js) It works the same for windows. – K.Igor Aug 14 '21 at 09:10

0 Answers0