Add PostgresSQL support (⚠️Development)

This commit is contained in:
Nikiroy78 2023-05-31 13:58:21 +03:00 committed by GitHub
parent b6dfa9908e
commit ebb37b9c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

15
postgresql.js Normal file
View File

@ -0,0 +1,15 @@
/* PostreSQL */
const pgsync = require('pg-sync');
class PostgreSQL_Database {
constructor (host, port, database, clientOptions={}) {
this.client = new pgsync.Client(clientOptions);
client.connect(`host=${host} port=${port} dbname=${database}`);
this.client.begin();
this.client.setIsolationLevelSerializable();
// this.client.query(queryText, [params]); -> execute command with SELECT *
// (this.client.prepare(queryText)).execute([params]); -> execute command without SELECT *
}
}