Add PostgresSQL support (⚠️Development)
This commit is contained in:
parent
b6dfa9908e
commit
ebb37b9c93
15
postgresql.js
Normal file
15
postgresql.js
Normal 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 *
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user