Skip to content

Commit

Permalink
chore: Add PostgresContainer to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Sironheart committed Oct 23, 2022
1 parent a6c3c4d commit ef831a0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,28 @@ $pdo = new \PDO(
// Do something with pdo
```

### PostgreSQL

```php
<?php

use Testcontainer\Container\PostgresContainer;

$container = new PostgresContainer('15.0', 'password');
$container->withPostgresDatabase('database');
$container->withPostgresUser('username');

$container->run();

$pdo = new \PDO(
sprintf('pgsql:host=%s;port=5432;dbname=database', $container->getAddress()),
'username',
'password',
);

// Do something with pdo
```

### Redis

```php
Expand Down

0 comments on commit ef831a0

Please sign in to comment.