server for my chess game
jsdoc pg.js
bendn 2022-10-12
parent 8339d39 · commit 4a06835
-rw-r--r--src/pg.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pg.js b/src/pg.js
index 9044de7..a2ac98c 100644
--- a/src/pg.js
+++ b/src/pg.js
@@ -10,6 +10,12 @@ pool.on("error", (err) => {
console.error("database: err:", err);
});
+/**
+ * Runs a SQL command on the database
+ *
+ * @param {String} command The command to run
+ * @returns {(undefined|Object)} result
+ */
export async function command(command) {
let client;
try {