chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:32:25 +08:00
commit e014feafe1
2285 changed files with 1131979 additions and 0 deletions
@@ -0,0 +1,28 @@
import pkg from "pg";
const { Client } = pkg;
export class Database {
constructor(config) {
this.client = new Client(config);
this.client.connect();
}
query(sql, args) {
return new Promise((resolve, reject) => {
this.client.query(sql, args, (err, rows) => {
if (err) return reject(err);
return resolve(rows);
});
});
}
close() {
this.client.end((err) => {
if (err) {
console.error(err);
} else {
console.log("db connection closed");
}
});
}
}