You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2018. It is now read-only.
You should know that that code does nothing really. It doesn't connect to the database, merely creates a new database object, as this library uses lazy connection. This is why in all the examples db is created once, globally.
And since event extend is triggered for each such object, it would only reduce the performance, trying to extend every new instance created, while quite pointlessly.
The text was updated successfully, but these errors were encountered:
Object db represents the database protocol, with lazy database connection, i.e. only the actual query methods acquire and release the connection. Therefore, you should create only one global/shared db object per connection details.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
on your code here:
postgis-editor/src/database.js
Line 25 in b13ab81
You should know that that code does nothing really. It doesn't connect to the database, merely creates a new database object, as this library uses lazy connection. This is why in all the examples
db
is created once, globally.See also related: http://stackoverflow.com/questions/36120435/verify-database-connection-with-pg-promise-when-starting-an-app
And since event extend is triggered for each such object, it would only reduce the performance, trying to extend every new instance created, while quite pointlessly.
The text was updated successfully, but these errors were encountered: