12/**3* PGClient is a client for Postgres database.4* Internally client uses go-pg/pg driver.5* @example6* ```javascript7* const postgres = require('nuclei/postgres');8* const client = new postgres.PGClient;9* ```10*/11export class PGClient {121314// Constructor of PGClient15constructor() {}16/**17* IsPostgres checks if the given host and port are running Postgres database.18* If connection is successful, it returns true.19* If connection is unsuccessful, it returns false and error.20* @example21* ```javascript22* const postgres = require('nuclei/postgres');23* const isPostgres = postgres.IsPostgres('acme.com', 5432);24* ```25*/26public IsPostgres(host: string, port: number): boolean | null {27return null;28}293031/**32* Connect connects to Postgres database using given credentials.33* If connection is successful, it returns true.34* If connection is unsuccessful, it returns false and error.35* The connection is closed after the function returns.36* @example37* ```javascript38* const postgres = require('nuclei/postgres');39* const client = new postgres.PGClient;40* const connected = client.Connect('acme.com', 5432, 'username', 'password');41* ```42*/43public Connect(host: string, port: number, username: string): boolean | null {44return null;45}464748/**49* ExecuteQuery connects to Postgres database using given credentials and database name.50* and executes a query on the db.51* If connection is successful, it returns the result of the query.52* @example53* ```javascript54* const postgres = require('nuclei/postgres');55* const client = new postgres.PGClient;56* const result = client.ExecuteQuery('acme.com', 5432, 'username', 'password', 'dbname', 'select * from users');57* log(to_json(result));58* ```59*/60public ExecuteQuery(host: string, port: number, username: string): SQLResult | null | null {61return null;62}636465/**66* ConnectWithDB connects to Postgres database using given credentials and database name.67* If connection is successful, it returns true.68* If connection is unsuccessful, it returns false and error.69* The connection is closed after the function returns.70* @example71* ```javascript72* const postgres = require('nuclei/postgres');73* const client = new postgres.PGClient;74* const connected = client.ConnectWithDB('acme.com', 5432, 'username', 'password', 'dbname');75* ```76*/77public ConnectWithDB(host: string, port: number, username: string): boolean | null {78return null;79}808182}83848586/**87* SQLResult Interface88*/89export interface SQLResult {9091Count?: number,9293Columns?: string[],94}95969798