mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Expose TypeOverrides in esm & cjs from root of package
This commit is contained in:
parent
e8280d58f6
commit
0342ded2b8
@ -1,6 +1,17 @@
|
||||
import assert from 'node:assert'
|
||||
import { describe, it } from 'node:test'
|
||||
import pg, { Client, Pool } from 'pg'
|
||||
import pg, {
|
||||
Client,
|
||||
Pool,
|
||||
Connection,
|
||||
defaults,
|
||||
types,
|
||||
DatabaseError,
|
||||
escapeIdentifier,
|
||||
escapeLiteral,
|
||||
Result,
|
||||
TypeOverrides,
|
||||
} from 'pg'
|
||||
|
||||
describe('pg', () => {
|
||||
it('should export Client constructor', () => {
|
||||
@ -14,4 +25,36 @@ describe('pg', () => {
|
||||
it('should still provide default export', () => {
|
||||
assert.ok(new pg.Pool())
|
||||
})
|
||||
|
||||
it('should export Connection constructor', () => {
|
||||
assert.ok(new Connection())
|
||||
})
|
||||
|
||||
it('should export defaults', () => {
|
||||
assert.ok(defaults)
|
||||
})
|
||||
|
||||
it('should export types', () => {
|
||||
assert.ok(types)
|
||||
})
|
||||
|
||||
it('should export DatabaseError', () => {
|
||||
assert.ok(DatabaseError)
|
||||
})
|
||||
|
||||
it('should export escapeIdentifier', () => {
|
||||
assert.ok(escapeIdentifier)
|
||||
})
|
||||
|
||||
it('should export escapeLiteral', () => {
|
||||
assert.ok(escapeLiteral)
|
||||
})
|
||||
|
||||
it('should export Result', () => {
|
||||
assert.ok(Result)
|
||||
})
|
||||
|
||||
it('should export TypeOverrides', () => {
|
||||
assert.ok(TypeOverrides)
|
||||
})
|
||||
})
|
||||
|
||||
@ -10,6 +10,8 @@ export const Query = pg.Query
|
||||
export const DatabaseError = pg.DatabaseError
|
||||
export const escapeIdentifier = pg.escapeIdentifier
|
||||
export const escapeLiteral = pg.escapeLiteral
|
||||
export const Result = pg.Result
|
||||
export const TypeOverrides = pg.TypeOverrides
|
||||
|
||||
// Also export the defaults
|
||||
export const defaults = pg.defaults
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
var Client = require('./client')
|
||||
var defaults = require('./defaults')
|
||||
var Connection = require('./connection')
|
||||
var Result = require('./result')
|
||||
var utils = require('./utils')
|
||||
var Pool = require('pg-pool')
|
||||
const Client = require('./client')
|
||||
const defaults = require('./defaults')
|
||||
const Connection = require('./connection')
|
||||
const Result = require('./result')
|
||||
const utils = require('./utils')
|
||||
const Pool = require('pg-pool')
|
||||
const TypeOverrides = require('./type-overrides')
|
||||
const { DatabaseError } = require('pg-protocol')
|
||||
const { escapeIdentifier, escapeLiteral } = require('./utils')
|
||||
|
||||
@ -26,6 +27,7 @@ var PG = function (clientConstructor) {
|
||||
this.Connection = Connection
|
||||
this.types = require('pg-types')
|
||||
this.DatabaseError = DatabaseError
|
||||
this.TypeOverrides = TypeOverrides
|
||||
this.escapeIdentifier = escapeIdentifier
|
||||
this.escapeLiteral = escapeLiteral
|
||||
this.Result = Result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user