Skip to content

Commit 72f44e5

Browse files
Tweaks to the doc strings for factory functions and constructors of
Connection and ConnectionPool.
1 parent 0797ae1 commit 72f44e5

File tree

2 files changed

+44
-25
lines changed

2 files changed

+44
-25
lines changed

src/oracledb/connection.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,24 @@ def __init__(self,
6565
6666
The dsn parameter (data source name) can be a string in the format
6767
user/password@connect_string or can simply be the connect string (in
68-
which case the user and password need to be specified separately). See
69-
the documentation on connection strings for more information.
68+
which case authentication credentials such as the username and password
69+
need to be specified separately). See the documentation on connection
70+
strings for more information.
7071
7172
The pool parameter is expected to be a pool object and the use of this
7273
parameter is the equivalent of calling acquire() on the pool.
7374
7475
The params parameter is expected to be of type ConnectParams and
7576
contains connection parameters that will be used when establishing the
76-
connection. See the documentation on ConnectParams for more
77+
connection. See the documentation on ConnectParams for more
7778
information. If this parameter is not specified, the additional keyword
7879
parameters will be used to create an instance of ConnectParams. If both
79-
the params parameter and additional keyword parameters are specified an
80-
exception is raised. Note that if a dsn is also supplied, the params
81-
will be modified to contain the connection parameters found within the
82-
dsn.
80+
the params parameter and additional keyword parameters are specified,
81+
the values in the keyword parameters have precedence. Note that if a dsn
82+
is also supplied, then in the python-oracledb Thin mode, the values of
83+
the parameters specified (if any) within the dsn will override the
84+
values passed as additional keyword parameters, which themselves
85+
override the values set in the params parameter object.
8386
"""
8487

8588
# if this variable is not present, exceptions raised during
@@ -1053,8 +1056,9 @@ def connect(dsn: str=None, *,
10531056
10541057
The dsn parameter (data source name) can be a string in the format
10551058
user/password@connect_string or can simply be the connect string (in
1056-
which case the user and password need to be specified separately). See the
1057-
documentation on connection strings for more information.
1059+
which case authentication credentials such as the username and password
1060+
need to be specified separately). See the documentation on connection
1061+
strings for more information.
10581062
10591063
The pool parameter is expected to be a pool object and the use of this
10601064
parameter is the equivalent of calling pool.acquire().
@@ -1067,8 +1071,11 @@ def connect(dsn: str=None, *,
10671071
See the documentation on ConnectParams for more information. If this
10681072
parameter is not specified, the additional keyword parameters will be used
10691073
to create an instance of ConnectParams. If both the params parameter and
1070-
additional keyword parameters are specified an exception is raised. Note
1071-
that if a dsn is also supplied, the params will be modified to contain the
1072-
connection parameters found within the dsn.
1074+
additional keyword parameters are specified, the values in the keyword
1075+
parameters have precedence. Note that if a dsn is also supplied,
1076+
then in the python-oracledb Thin mode, the values of the parameters
1077+
specified (if any) within the dsn will override the values passed as
1078+
additional keyword parameters, which themselves override the values set in
1079+
the params parameter object.
10731080
"""
10741081
pass

src/oracledb/pool.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,23 @@ def __init__(self, dsn: str=None, *,
5454
where connections are requested in rapid succession and used for a
5555
short period of time, for example in a web server.
5656
57-
The pool_params parameter is expected to be of type PoolParams and
58-
containins pool configuration parameters. If not specified, a new
59-
instance will be created using the additional keyword arguments.
60-
61-
The conn_params parameter is expected to be of type ConnectParams and
62-
contains connection parameters that will be used when creating
63-
connections to the database. If not specified, a new instance will be
64-
created using the additional keyword arguments.
57+
The dsn parameter (data source name) can be a string in the format
58+
user/password@connect_string or can simply be the connect string (in
59+
which case authentication credentials such as the username and password
60+
need to be specified separately). See the documentation on connection
61+
strings for more information.
62+
63+
The params parameter is expected to be of type PoolParams and contains
64+
parameters that are used to create the pool. See the documentation on
65+
PoolParams for more information. If this parameter is not specified, the
66+
additional keyword parameters will be used to create an instance of
67+
PoolParams. If both the params parameter and additional keyword
68+
parameters are specified, the values in the keyword parameters have
69+
precedence. Note that if a dsn is also supplied, then in the
70+
python-oracledb Thin mode, the values of the parameters specified
71+
(if any) within the dsn will override the values passed as additional
72+
keyword parameters, which themselves override the values set in the
73+
params parameter object.
6574
"""
6675
self._impl = None
6776
if params is None:
@@ -608,8 +617,9 @@ def create_pool(dsn: str=None, *,
608617
609618
The dsn parameter (data source name) can be a string in the format
610619
user/password@connect_string or can simply be the connect string (in
611-
which case the user and password need to be specified separately). See the
612-
documentation on connection strings for more information.
620+
which case authentication credentials such as the username and password
621+
need to be specified separately). See the documentation on connection
622+
strings for more information.
613623
614624
The pool_class parameter is expected to be ConnectionPool or a subclass of
615625
ConnectionPool.
@@ -619,8 +629,10 @@ def create_pool(dsn: str=None, *,
619629
PoolParams for more information. If this parameter is not specified, the
620630
additional keyword parameters will be used to create an instance of
621631
PoolParams. If both the params parameter and additional keyword parameters
622-
are specified an exception is raised. Note that if a dsn is also supplied,
623-
the params will be modified to contain the connection parameters found
624-
within the dsn.
632+
are specified, the values in the keyword parameters have precedence.
633+
Note that if a dsn is also supplied, then in the python-oracledb Thin mode,
634+
the values of the parameters specified (if any) within the dsn will override
635+
the values passed as additional keyword parameters, which themselves
636+
override the values set in the params parameter object.
625637
"""
626638
pass

0 commit comments

Comments
 (0)