2

I have written a query to select rows in table using seriate, now the query is able to fetch the results but the command is not exiting unless I do ctrl + c in the git bash window.
Is there anyway to close the connection and come out of the session once the insert query is successful?

rahoolm
  • 733
  • 2
  • 12
  • 22

2 Answers2

2

The trick was to use sql.closeConnection() after getting the results. Found it by trying the steps in interactive mode - node REPL.

rahoolm
  • 733
  • 2
  • 12
  • 22
0

To end a process successfully use process.exit(0) or process.exit(1) (or any error code that makes sense for your app) if you encountered an error

Ramses
  • 996
  • 4
  • 12
  • 28
  • I was not asking about how to exit the nodejs process but how to close the connection. Got the solution now :) Thanks – rahoolm Sep 12 '16 at 15:33