Node-sqlite3: best practice use node-sqlite3 in express app

Created on 27 Apr 2014  路  1Comment  路  Source: mapbox/node-sqlite3

Hi,

what is a good practice to use node-sqlite3 in an Express App? do we have to open and close db for every insert? thanks,

Angelo

Most helpful comment

No, you open the db when you start the server, then you execute statements whenver you need to. When the app shuts down (e.g. by intercepting SIGINT or SIGKILL), you close the DB handle.

>All comments

No, you open the db when you start the server, then you execute statements whenver you need to. When the app shuts down (e.g. by intercepting SIGINT or SIGKILL), you close the DB handle.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevinmannn picture kevinmannn  路  40Comments

milu2003 picture milu2003  路  16Comments

j-berman picture j-berman  路  20Comments

hersoncruz picture hersoncruz  路  27Comments

sushantdhiman picture sushantdhiman  路  20Comments