Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d132d3

Browse files
committed
documentation fixes
1 parent be1e509 commit 7d132d3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ At current state it only works with Python 2.*
1717

1818
> Node: by default testgres runs `initdb`, `pg_ctl`, `psql` commands from the `$PATH`. To specify custom postgres installation set environment variable `$PG_CONFIG` and point it to pg_config executable: `export PG_CONFIG=/path/to/pg_config`
1919
20-
Here is an example of how you can use `testgres`
20+
Here is an example of how you can use `testgres`.
2121

2222
```python
2323
from testgres import get_new_node
@@ -39,13 +39,13 @@ Let's walk through the code. First you create new node:
3939
node = get_new_node('master')
4040
```
4141

42-
`master` here is a node's name, not the database's name. The name matters if you're testing replication. Function get_new_node() only creates directory structure in `/tmp` for cluster. Next line:
42+
`master` here is a node's name, not the database's name. The name matters if you're testing replication. Function `get_new_node()` only creates directory structure in `/tmp` for cluster. Next line:
4343

4444
```python
4545
node.init()
4646
```
4747

48-
initializes claster. On low level it runs `initdb` command and adds some basic configuration to `postgresql.conf` and `pg_hba.conf` files. Function `init()` accepts optional parameter `allows_streaming` which configures cluster for streaming replication (default is `False`).
48+
initializes cluster. On low level it runs `initdb` command and adds some basic configuration to `postgresql.conf` and `pg_hba.conf` files. Function `init()` accepts optional parameter `allows_streaming` which configures cluster for streaming replication (default is `False`).
4949
Now we are ready to start:
5050

5151
```python
@@ -54,12 +54,14 @@ node.start()
5454

5555
After this you are able to run queries over the cluster. There is three functions to do that:
5656

57-
* node.psql(database, query) - runs query via `psql` command and returns tuple (error code, stdout, stderr)
58-
* node.safe_psql(database, query) - the same as `psql()` except that it returns only `stdout`. If error occures during the execution then it will throw an exception;
59-
* node.execute(database, query) - connects with postgresql server using `psycopg2` or `pg8000` library (depends on which is installed in your system) and returns two-dimensional array with data.
57+
* `node.psql(database, query)` - runs query via `psql` command and returns tuple (error code, stdout, stderr)
58+
* `node.safe_psql(database, query)` - the same as `psql()` except that it returns only `stdout`. If error occures during the execution then it will throw an exception;
59+
* `node.execute(database, query)` - connects with postgresql server using `psycopg2` or `pg8000` library (depends on which is installed in your system) and returns two-dimensional array with data.
6060

6161
To stop server run:
6262

6363
```python
6464
node.stop()
6565
```
66+
67+
Please see `testgres/tests` directory for replication configuration example.

0 commit comments

Comments
 (0)