Help connecting to Postgres Container #240
-
Sorry, I am new to this library and docker in general but would really appreciate any help or guidance. I'm hoping to set up a container with a Postgres DB where I can eventually connect to it and unit test some queries. Here are my questions: Here are the errors I am running into currently:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
This comment has been hidden.
This comment has been hidden.
-
@alexlin51 I've just published a PostgreSQL module to make this easier for everyone, it's available in 7.17.0. README is here, which includes links to examples: https://github.com/testcontainers/testcontainers-node/tree/master/src/modules/postgresql. Using it is as simple as: import { PostgreSqlContainer } from "testcontainers";
const container = await new PostgreSqlContainer().start(); (See the examples for further customisation options, such as setting the database/username/password). Hope that helps 🙂 |
Beta Was this translation helpful? Give feedback.
@alexlin51 I've just published a PostgreSQL module to make this easier for everyone, it's available in 7.17.0.
README is here, which includes links to examples: https://github.com/testcontainers/testcontainers-node/tree/master/src/modules/postgresql.
Using it is as simple as:
(See the examples for further customisation options, such as setting the database/username/password).
Hope that helps 🙂