UNPKG

vertica-nodejs

Version:

Vertica client - pure javascript & libpq with the same API

46 lines (39 loc) 1.37 kB
// Copyright (c) 2022-2024 Open Text. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. 'use strict' var Client = require('./client') var defaults = require('./defaults') var Connection = require('./connection') var Pool = require('v-pool') const { DatabaseError } = require('v-protocol') const packageJson = require('../package.json') const poolFactory = (Client) => { return class BoundPool extends Pool { constructor(options) { super(options, Client) } } } var Vertica = function (clientConstructor) { this.defaults = defaults this.Client = clientConstructor this.Query = this.Client.Query this.Pool = poolFactory(this.Client) this._pools = [] this.Connection = Connection this.types = require('pg-types') this.DatabaseError = DatabaseError this.version = packageJson.version } module.exports = new Vertica(Client)