@@ -800,7 +800,7 @@ async def copy_from_table(self, table_name, *, output,
800
800
... output='file.csv', format='csv')
801
801
... print(result)
802
802
...
803
- >>> asyncio.get_event_loop().run_until_complete (run())
803
+ >>> asyncio.run (run())
804
804
'COPY 100'
805
805
806
806
.. _`COPY statement documentation`:
@@ -869,7 +869,7 @@ async def copy_from_query(self, query, *args, output,
869
869
... output='file.csv', format='csv')
870
870
... print(result)
871
871
...
872
- >>> asyncio.get_event_loop().run_until_complete (run())
872
+ >>> asyncio.run (run())
873
873
'COPY 10'
874
874
875
875
.. _`COPY statement documentation`:
@@ -945,7 +945,7 @@ async def copy_to_table(self, table_name, *, source,
945
945
... 'mytable', source='datafile.tbl')
946
946
... print(result)
947
947
...
948
- >>> asyncio.get_event_loop().run_until_complete (run())
948
+ >>> asyncio.run (run())
949
949
'COPY 140000'
950
950
951
951
.. _`COPY statement documentation`:
@@ -1027,7 +1027,7 @@ async def copy_records_to_table(self, table_name, *, records,
1027
1027
... (2, 'ham', 'spam')])
1028
1028
... print(result)
1029
1029
...
1030
- >>> asyncio.get_event_loop().run_until_complete (run())
1030
+ >>> asyncio.run (run())
1031
1031
'COPY 2'
1032
1032
1033
1033
Asynchronous record iterables are also supported:
@@ -1045,7 +1045,7 @@ async def copy_records_to_table(self, table_name, *, records,
1045
1045
... 'mytable', records=record_gen(100))
1046
1046
... print(result)
1047
1047
...
1048
- >>> asyncio.get_event_loop().run_until_complete (run())
1048
+ >>> asyncio.run (run())
1049
1049
'COPY 100'
1050
1050
1051
1051
.. versionadded:: 0.11.0
@@ -1305,7 +1305,7 @@ async def set_type_codec(self, typename, *,
1305
1305
... print(result)
1306
1306
... print(datetime.datetime(2002, 1, 1) + result)
1307
1307
...
1308
- >>> asyncio.get_event_loop().run_until_complete (run())
1308
+ >>> asyncio.run (run())
1309
1309
relativedelta(years=+2, months=+3, days=+1)
1310
1310
2004-04-02 00:00:00
1311
1311
@@ -1772,7 +1772,7 @@ async def reload_schema_state(self):
1772
1772
... await con.execute('LOCK TABLE tbl')
1773
1773
... await change_type(con)
1774
1774
...
1775
- >>> asyncio.get_event_loop().run_until_complete (run())
1775
+ >>> asyncio.run (run())
1776
1776
1777
1777
.. versionadded:: 0.14.0
1778
1778
"""
@@ -2258,7 +2258,7 @@ async def connect(dsn=None, *,
2258
2258
... types = await con.fetch('SELECT * FROM pg_type')
2259
2259
... print(types)
2260
2260
...
2261
- >>> asyncio.get_event_loop().run_until_complete (run())
2261
+ >>> asyncio.run (run())
2262
2262
[<Record typname='bool' typnamespace=11 ...
2263
2263
2264
2264
.. versionadded:: 0.10.0
0 commit comments