@@ -116,12 +116,13 @@ async def add_listener(self, channel, callback):
116
116
"""Add a listener for Postgres notifications.
117
117
118
118
:param str channel: Channel to listen on.
119
+
119
120
:param callable callback:
120
- A callable receiving the following arguments:
121
- **connection**: a Connection the callback is registered with;
122
- **pid**: PID of the Postgres server that sent the notification;
123
- **channel**: name of the channel the notification was sent to;
124
- **payload**: the payload.
121
+ A callable receiving the following arguments:
122
+ **connection**: a Connection the callback is registered with;
123
+ **pid**: PID of the Postgres server that sent the notification;
124
+ **channel**: name of the channel the notification was sent to;
125
+ **payload**: the payload.
125
126
"""
126
127
self ._check_open ()
127
128
if channel not in self ._listeners :
@@ -245,7 +246,7 @@ async def executemany(self, command: str, args,
245
246
... ''', [(1, 2, 3), (4, 5, 6)])
246
247
247
248
:param command: Command to execute.
248
- :args: An iterable containing sequences of arguments.
249
+ :param args: An iterable containing sequences of arguments.
249
250
:param float timeout: Optional timeout value in seconds.
250
251
:return None: This method discards the results of the operations.
251
252
@@ -713,43 +714,52 @@ async def connect(dsn=None, *,
713
714
714
715
Returns a new :class:`~asyncpg.connection.Connection` object.
715
716
716
- :param dsn: Connection arguments specified using as a single string in the
717
- following format:
718
- ``postgres://user:pass@host:port/database?option=value``
717
+ :param dsn:
718
+ Connection arguments specified using as a single string in the
719
+ following format:
720
+ ``postgres://user:pass@host:port/database?option=value``
719
721
720
- :param host: database host address or a path to the directory containing
721
- database server UNIX socket (defaults to the default UNIX
722
- socket, or the value of the ``PGHOST`` environment variable ,
723
- if set).
722
+ :param host:
723
+ database host address or a path to the directory containing
724
+ database server UNIX socket (defaults to the default UNIX socket ,
725
+ or the value of the ``PGHOST`` environment variable, if set).
724
726
725
- :param port: connection port number (defaults to ``5432``, or the value of
726
- the ``PGPORT`` environment variable, if set)
727
+ :param port:
728
+ connection port number (defaults to ``5432``, or the value of
729
+ the ``PGPORT`` environment variable, if set)
727
730
728
- :param user: the name of the database role used for authentication
729
- (defaults to the name of the effective user of the process
730
- making the connection, or the value of ``PGUSER`` environment
731
- variable, if set)
731
+ :param user:
732
+ the name of the database role used for authentication
733
+ (defaults to the name of the effective user of the process
734
+ making the connection, or the value of ``PGUSER`` environment
735
+ variable, if set)
732
736
733
- :param database: the name of the database (defaults to the value of
734
- ``PGDATABASE`` environment variable, if set.)
737
+ :param database:
738
+ the name of the database (defaults to the value of ``PGDATABASE``
739
+ environment variable, if set.)
735
740
736
- :param password: password used for authentication
741
+ :param password:
742
+ password used for authentication
737
743
738
- :param loop: An asyncio event loop instance. If ``None``, the default
739
- event loop will be used.
744
+ :param loop:
745
+ An asyncio event loop instance. If ``None``, the default
746
+ event loop will be used.
740
747
741
- :param float timeout: connection timeout in seconds.
748
+ :param float timeout:
749
+ connection timeout in seconds.
742
750
743
- :param int statement_cache_size: the size of prepared statement LRU cache.
744
- Pass ``0`` to disable the cache.
751
+ :param int statement_cache_size:
752
+ the size of prepared statement LRU cache. Pass ``0`` to
753
+ disable the cache.
745
754
746
755
:param int max_cached_statement_lifetime:
747
756
the maximum time in seconds a prepared statement will stay
748
757
in the cache. Pass ``0`` to allow statements be cached
749
758
indefinitely.
750
759
751
- :param float command_timeout: the default timeout for operations on
752
- this connection (the default is no timeout).
760
+ :param float command_timeout:
761
+ the default timeout for operations on this connection
762
+ (the default is no timeout).
753
763
754
764
:return: A :class:`~asyncpg.connection.Connection` instance.
755
765
0 commit comments