We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f0cdcc commit 343b0aeCopy full SHA for 343b0ae
src/persistence/postgres.js
@@ -59,13 +59,13 @@ async function getItems() {
59
}
60
61
62
-// Drop the table if it exists
+// End the connection
63
async function teardown() {
64
- return client.query('DROP TABLE IF EXISTS todo_items').then(() => {
65
- console.log('Dropped the table');
66
- }).catch(err => {
67
- console.error('Unable to drop the table:', err);
68
- });
+ return client.end().then(() => {
+ console.log('Client ended');
+ }).catch(err => {
+ console.error('Unable to end client:', err);
+ });
69
70
71
// Get one item by id from the table
0 commit comments