Skip to content

Commit f343538

Browse files
committed
Fix README
1 parent e001345 commit f343538

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import testgres
5353
with testgres.get_new_node('test') as node:
5454
node.init() # run initdb
5555
node.start() # start PostgreSQL
56-
print(node.execute('postgres', 'select 1'))
56+
print(await node.fetch('postgres', 'select 1'))
5757
node.stop() # stop PostgreSQL
5858
```
5959

@@ -93,10 +93,10 @@ Finally, our temporary cluster is able to process queries. There are four ways t
9393

9494
The last one is the most powerful: you can use `begin(isolation_level)`, `commit()` and `rollback()`:
9595
```python
96-
with node.connect() as con:
97-
con.begin('serializable')
98-
print(con.execute('select %s', 1))
99-
con.rollback()
96+
async with node.connect() as con:
97+
await con.begin('serializable')
98+
print(await con.fetch('select %s', 1))
99+
await con.rollback()
100100
```
101101

102102
To stop the server, run:
@@ -115,7 +115,7 @@ with testgres.get_new_node('master') as master:
115115
master.init().start()
116116
with master.backup() as backup:
117117
replica = backup.spawn_replica('replica').start()
118-
print(replica.execute('postgres', 'select 1'))
118+
print(await replica.fetch('postgres', 'select 1'))
119119
```
120120

121121
> Note: you could take a look at [`pg_pathman`](https://github.com/postgrespro/pg_pathman) to get an idea of `testgres`' capabilities.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy