Skip to content

Commit cc19215

Browse files
mremondtanner0101
authored andcommitted
Add doc on how to run the tests (#56)
* Fix typo * Add doc on how to run the tests.
1 parent 14e8468 commit cc19215

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PostgresNIO is a client package for connecting to, authorizing, and querying a P
4848

4949
Support for both simple (text) and parameterized (binary) querying is provided out of the box alongside a `PostgresData` type that handles conversion between PostgreSQL's wire format and native Swift types.
5050

51-
### Motiviation
51+
### Motivation
5252

5353
Most Swift implementations of Postgres clients are based on the [libpq](https://www.postgresql.org/docs/11/libpq.html) C library which handles transport internally. Building a library directly on top of Postgres' wire protocol using SwiftNIO should yield a more reliable, maintainable, and performant interface for PostgreSQL databases.
5454

@@ -210,3 +210,36 @@ print(data.numeric) // PostgresNumeric?
210210
```
211211

212212
`PostgresData` is also used for sending data _to_ the server via parameterized values. To create `PostgresData` from a Swift type, use the available intializer methods.
213+
214+
## Library development
215+
216+
If you want to contribute to the library development, here is how to get started.
217+
218+
### Testing
219+
220+
To run the test, you need to start a local PostgreSQL database using Docker.
221+
222+
If you have Docker installed and running, you can use Docker Compose to start PostgreSQL:
223+
224+
The following command will download the required containers to run the test and start them:
225+
226+
```
227+
$ docker-compose up -d psql-11
228+
```
229+
230+
You can choose to run one of the following PostgreSQL version: `psql-11`, `psql-10`, `psql-9`, `psql-ssl`.
231+
232+
From another console or from Xcode, you can then run the test:
233+
234+
```
235+
$ swift test
236+
```
237+
238+
You can check that the test are passing, before adding your own to the test suite.
239+
240+
Finally, you can shut down and clean up Docker test environment with:
241+
242+
```
243+
$ docker-compose down --volumes
244+
```
245+

0 commit comments

Comments
 (0)