UNPKG

quickpostgres

Version:

An easy, beginner-friendly PostgreSQL database wrapper similar to quick.db.

24 lines 715 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = async (db, params, options) => { // Fetch entry const fetched = await db.query(`SELECT * FROM ${options.table} WHERE ID IS NOT NULL`); console.log(fetched); const response = []; fetched.rows.forEach(async (row) => { try { let data = JSON.parse(row.json); if (typeof data === "string") data = JSON.parse(data); response.push({ ID: row.ID, data, }); } catch (_a) { // continue regardless of error } }); return response; }; //# sourceMappingURL=all.js.map