Skip to content

Commit

Permalink
fix: postgresql connection URL can use an UNIX Socket (#2614) (#6042)
Browse files Browse the repository at this point in the history
  • Loading branch information
paeolo committed Oct 7, 2020
1 parent 2d9a3ce commit 21c4166
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/driver/postgres/PostgresDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {Driver} from "../Driver";
import {ConnectionIsNotSetError} from "../../error/ConnectionIsNotSetError";
import {ObjectLiteral} from "../../common/ObjectLiteral";
import {DriverPackageNotInstalledError} from "../../error/DriverPackageNotInstalledError";
import {DriverUtils} from "../DriverUtils";
import {ColumnMetadata} from "../../metadata/ColumnMetadata";
import {PostgresQueryRunner} from "./PostgresQueryRunner";
import {DateUtils} from "../../util/DateUtils";
Expand Down Expand Up @@ -971,11 +970,12 @@ export class PostgresDriver implements Driver {
*/
protected async createPool(options: PostgresConnectionOptions, credentials: PostgresConnectionCredentialsOptions): Promise<any> {

credentials = Object.assign({}, credentials, DriverUtils.buildDriverOptions(credentials)); // todo: do it better way
credentials = Object.assign({}, credentials);

// build connection options for the driver
// See: https://github.com/brianc/node-postgres/tree/master/packages/pg-pool#create
const connectionOptions = Object.assign({}, {
connectionString: credentials.url,
host: credentials.host,
user: credentials.username,
password: credentials.password,
Expand Down

0 comments on commit 21c4166

Please sign in to comment.