Skip to content

Commit e4c1118

Browse files
committed
Release version 3.0.3 of DBUtils
1 parent 0158b8c commit e4c1118

File tree

6 files changed

+100
-47
lines changed

6 files changed

+100
-47
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Christoph Zwerschke
3+
Copyright (c) 2023 Christoph Zwerschke
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ to a database that can be used in all kinds of multi-threaded environments.
77
The suite supports DB-API 2 compliant database interfaces
88
and the classic PyGreSQL interface.
99

10-
The current version 3.0.2 of DBUtils supports Python versions 3.6 to 3.10.
10+
The current version 3.0.3 of DBUtils supports Python versions 3.6 to 3.11.
1111

1212
**Please have a look at the [changelog](https://webwareforpython.github.io/DBUtils/changelog.html), because there were some breaking changes in version 2.0.**
1313

changelog.html

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33
<head>
4-
<meta charset="utf-8"/>
4+
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
77
<title>Changelog for DBUtils</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />
99
</head>
@@ -12,18 +12,28 @@
1212
<h1 class="title">Changelog for DBUtils</h1>
1313

1414
<section id="section-1">
15+
<h2>3.0.3</h2>
16+
<p>DBUtils 3.0.3 was released on April 27, 2023.</p>
17+
<p>Changes:</p>
18+
<ul class="simple">
19+
<li><p>Support Python version 3.11.</p></li>
20+
<li><p>Improve determination of DB API module if creator is specified.</p></li>
21+
<li><p>Minor fixes and section an advanced usage in docs.</p></li>
22+
</ul>
23+
</section>
24+
<section id="section-2">
1525
<h2>3.0.2</h2>
1626
<p>DBUtils 3.0.2 was released on January 14, 2022.</p>
17-
<p>The the optional iterator protocol on cursors is now supported.</p>
27+
<p>The optional iterator protocol on cursors is now supported.</p>
1828
</section>
19-
<section id="section-2">
29+
<section id="section-3">
2030
<h2>3.0.1</h2>
2131
<p>DBUtils 3.0.1 was released on December 22, 2021.</p>
2232
<p>It includes <span class="docutils literal">InterfaceError</span> to the default list of exceptions
2333
for which the connection failover mechanism is applied.
2434
You can override this with the <span class="docutils literal">failures</span> parameter.</p>
2535
</section>
26-
<section id="section-3">
36+
<section id="section-4">
2737
<h2>3.0.0</h2>
2838
<p>DBUtils 3.0.0 was released on November 26, 2021.</p>
2939
<p>It is intended to be used with Python versions 3.6 to 3.10.</p>
@@ -32,31 +42,31 @@ <h2>3.0.0</h2>
3242
<li><p>Cease support for Python 2 and 3.5, minor optimizations.</p></li>
3343
</ul>
3444
</section>
35-
<section id="section-4">
45+
<section id="section-5">
3646
<h2>2.0.3</h2>
3747
<p>DBUtils 2.0.3 was released on November 26, 2021.</p>
3848
<p>Changes:</p>
3949
<ul class="simple">
4050
<li><p>Support Python version 3.10.</p></li>
4151
</ul>
4252
</section>
43-
<section id="section-5">
53+
<section id="section-6">
4454
<h2>2.0.2</h2>
4555
<p>DBUtils 2.0.2 was released on June 8, 2021.</p>
4656
<p>Changes:</p>
4757
<ul class="simple">
4858
<li><p>Allow using context managers for pooled connections.</p></li>
4959
</ul>
5060
</section>
51-
<section id="section-6">
61+
<section id="section-7">
5262
<h2>2.0.1</h2>
5363
<p>DBUtils 2.0.1 was released on April 8, 2021.</p>
5464
<p>Changes:</p>
5565
<ul class="simple">
5666
<li><p>Avoid &quot;name Exception is not defined&quot; when exiting.</p></li>
5767
</ul>
5868
</section>
59-
<section id="section-7">
69+
<section id="section-8">
6070
<h2>2.0</h2>
6171
<p>DBUtils 2.0 was released on September 26, 2020.</p>
6272
<p>It is intended to be used with Python versions 2.7 and 3.5 to 3.9.</p>
@@ -72,7 +82,7 @@ <h2>2.0</h2>
7282
<li><p>This changelog has been compiled from the former release notes.</p></li>
7383
</ul>
7484
</section>
75-
<section id="section-8">
85+
<section id="section-9">
7686
<h2>1.4</h2>
7787
<p>DBUtils 1.4 was released on September 26, 2020.</p>
7888
<p>It is intended to be used with Python versions 2.7 and 3.5 to 3.9.</p>
@@ -83,7 +93,7 @@ <h2>1.4</h2>
8393
inside a transaction.</p></li>
8494
</ul>
8595
</section>
86-
<section id="section-9">
96+
<section id="section-10">
8797
<h2>1.3</h2>
8898
<p>DBUtils 1.3 was released on March 3, 2018.</p>
8999
<p>It is intended to be used with Python versions 2.6, 2.7 and 3.4 to 3.7.</p>
@@ -92,12 +102,12 @@ <h2>1.3</h2>
92102
<li><p>This version now supports context handlers for connections and cursors.</p></li>
93103
</ul>
94104
</section>
95-
<section id="section-10">
105+
<section id="section-11">
96106
<h2>1.2</h2>
97107
<p>DBUtils 1.2 was released on February 5, 2017.</p>
98108
<p>It is intended to be used with Python versions 2.6, 2.7 and 3.0 to 3.6.</p>
99109
</section>
100-
<section id="section-11">
110+
<section id="section-12">
101111
<h2>1.1.1</h2>
102112
<p>DBUtils 1.1.1 was released on February 4, 2017.</p>
103113
<p>It is intended to be used with Python versions 2.3 to 2.7.</p>
@@ -111,7 +121,7 @@ <h2>1.1.1</h2>
111121
<li><p>Fixed a problem when running under Jython (reported by Vitaly Kruglikov).</p></li>
112122
</ul>
113123
</section>
114-
<section id="section-12">
124+
<section id="section-13">
115125
<h2>1.1</h2>
116126
<p>DBUtils 1.1 was released on August 14, 2011.</p>
117127
<p>Improvements:</p>
@@ -140,7 +150,7 @@ <h2>1.1</h2>
140150
<li><p>Fixed some minor issues with the <span class="docutils literal">DBUtilsExample</span> for Webware.</p></li>
141151
</ul>
142152
</section>
143-
<section id="section-13">
153+
<section id="section-14">
144154
<h2>1.0</h2>
145155
<p>DBUtils 1.0 was released on November 29, 2008.</p>
146156
<p>It is intended to be used with Python versions 2.2 to 2.6.</p>
@@ -173,7 +183,7 @@ <h2>1.0</h2>
173183
the MySQLdb module (problem reported by Gregory Pinero).</p></li>
174184
</ul>
175185
</section>
176-
<section id="section-14">
186+
<section id="section-15">
177187
<h2>0.9.4</h2>
178188
<p>DBUtils 0.9.4 was released on July 7, 2007.</p>
179189
<p>This release fixes a problem in the destructor code and has been supplemented
@@ -182,7 +192,7 @@ <h2>0.9.4</h2>
182192
in the last release, since you can now pass custom creator functions
183193
for database connections instead of DB-API 2 modules.</p>
184194
</section>
185-
<section id="section-15">
195+
<section id="section-16">
186196
<h2>0.9.3</h2>
187197
<p>DBUtils 0.9.3 was released on May 21, 2007.</p>
188198
<p>Changes:</p>
@@ -197,7 +207,7 @@ <h2>0.9.3</h2>
197207
Added Chinese translation of the User's Guide, kindly contributed by gashero.</p></li>
198208
</ul>
199209
</section>
200-
<section id="section-16">
210+
<section id="section-17">
201211
<h2>0.9.2</h2>
202212
<p>DBUtils 0.9.2 was released on September 22, 2006.</p>
203213
<p>It is intended to be used with Python versions 2.2 to 2.5.</p>
@@ -207,7 +217,7 @@ <h2>0.9.2</h2>
207217
storage engine. Accordingly, renamed <span class="docutils literal">SolidPg</span> to <span class="docutils literal">SteadyPg</span>.</p></li>
208218
</ul>
209219
</section>
210-
<section id="section-17">
220+
<section id="section-18">
211221
<h2>0.9.1</h2>
212222
<p>DBUtils 0.9.1 was released on May 8, 2006.</p>
213223
<p>It is intended to be used with Python versions 2.2 to 2.4.</p>
@@ -221,7 +231,7 @@ <h2>0.9.1</h2>
221231
<li><p>Improved the documentation and added a User's Guide.</p></li>
222232
</ul>
223233
</section>
224-
<section id="section-18">
234+
<section id="section-19">
225235
<h2>0.8.1 - 2005-09-13</h2>
226236
<p>DBUtils 0.8.1 was released on September 13, 2005.</p>
227237
<p>It is intended to be used with Python versions 2.0 to 2.4.</p>

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ <h5><a href="changelog.html">Changelog</a></h5>
4242
<header><h2>Downloads</h2></header>
4343
<div>
4444
<h5>Current/Recommended Version:</h5>
45-
<a class="button" href="https://pypi.org/pypi/DBUtils/3.0.2/#files">Download <small>DBUtils 3.0.2</small></a>
46-
<p><small>(this version supports Python 3.6 to 3.10)</small></p>
45+
<a class="button" href="https://pypi.org/pypi/DBUtils/3.0.3/#files">Download <small>DBUtils 3.0.3</small></a>
46+
<p><small>(this version supports Python 3.6 to 3.11)</small></p>
4747
</div>
4848
<div>
4949
<h5>Older Versions:</h5>

main.de.html

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
33
<head>
4-
<meta charset="utf-8"/>
4+
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
77
<title>Benutzeranleitung für DBUtils</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />
99
</head>
@@ -12,7 +12,7 @@
1212
<h1 class="title">Benutzeranleitung für DBUtils</h1>
1313
<dl class="docinfo simple">
1414
<dt class="version">Version<span class="colon">:</span></dt>
15-
<dd class="version">3.0.2</dd>
15+
<dd class="version">3.0.3</dd>
1616
<dt class="translations">Translations<span class="colon">:</span></dt>
1717
<dd class="translations"><p><a class="reference external" href="main.html">English</a> | German</p>
1818
</dd>
@@ -44,12 +44,13 @@ <h1 class="title">Benutzeranleitung für DBUtils</h1>
4444
<li><p><a class="reference internal" href="#pooleddb-pooled-db-1" id="toc-entry-15">PooledDB (pooled_db)</a></p></li>
4545
</ul>
4646
</li>
47-
<li><p><a class="reference internal" href="#anmerkungen" id="toc-entry-16">Anmerkungen</a></p></li>
48-
<li><p><a class="reference internal" href="#zukunft" id="toc-entry-17">Zukunft</a></p></li>
49-
<li><p><a class="reference internal" href="#fehlermeldungen-und-feedback" id="toc-entry-18">Fehlermeldungen und Feedback</a></p></li>
50-
<li><p><a class="reference internal" href="#links" id="toc-entry-19">Links</a></p></li>
51-
<li><p><a class="reference internal" href="#autoren" id="toc-entry-20">Autoren</a></p></li>
52-
<li><p><a class="reference internal" href="#copyright-und-lizenz" id="toc-entry-21">Copyright und Lizenz</a></p></li>
47+
<li><p><a class="reference internal" href="#besonderheiten-bei-der-benutzung" id="toc-entry-16">Besonderheiten bei der Benutzung</a></p></li>
48+
<li><p><a class="reference internal" href="#anmerkungen" id="toc-entry-17">Anmerkungen</a></p></li>
49+
<li><p><a class="reference internal" href="#zukunft" id="toc-entry-18">Zukunft</a></p></li>
50+
<li><p><a class="reference internal" href="#fehlermeldungen-und-feedback" id="toc-entry-19">Fehlermeldungen und Feedback</a></p></li>
51+
<li><p><a class="reference internal" href="#links" id="toc-entry-20">Links</a></p></li>
52+
<li><p><a class="reference internal" href="#autoren" id="toc-entry-21">Autoren</a></p></li>
53+
<li><p><a class="reference internal" href="#copyright-und-lizenz" id="toc-entry-22">Copyright und Lizenz</a></p></li>
5354
</ul>
5455
</nav>
5556
<section id="zusammenfassung">
@@ -136,7 +137,7 @@ <h3>Installation</h3>
136137
</section>
137138
<section id="anforderungen">
138139
<h2>Anforderungen</h2>
139-
<p>DBUtils unterstützt die <a class="reference external" href="https://www.python.org">Python</a> Versionen 3.6 bis 3.10.</p>
140+
<p>DBUtils unterstützt die <a class="reference external" href="https://www.python.org">Python</a> Versionen 3.6 bis 3.11.</p>
140141
<p>Die Module in der Variante für klassisches PyGreSQL benötigen <a class="reference external" href="https://www.pygresql.org/">PyGreSQL</a>
141142
Version 4.0 oder höher, während die Module in der allgemeinen Variante
142143
für DB-API 2 mit jedem beliebigen Python-Datenbankadapter-Modul zusammenarbeiten,
@@ -435,6 +436,27 @@ <h3>PooledDB (pooled_db)</h3>
435436
wieder an den Verbindungspool zurückgegeben wird.</p>
436437
</section>
437438
</section>
439+
<section id="besonderheiten-bei-der-benutzung">
440+
<h2>Besonderheiten bei der Benutzung</h2>
441+
<p>Manchmal möchte man Datenbankverbindung besonders vorbereiten, bevor sie
442+
von DBUtils verwendet werden, und dies ist nicht immer durch Verwendung
443+
der passenden Parameter möglich. Zum Beispiel kann es <span class="docutils literal">pyodb</span> erfordern,
444+
dass man die Methode <span class="docutils literal">setencoding()</span> der Datenbankverbindung aufruft.
445+
Sie können dies erreichen, indem Sie eine modifizierte Version der
446+
Funktion <span class="docutils literal">connect()</span> verwenden und diese als <span class="docutils literal">creator</span> (dem ersten
447+
Argument) an <span class="docutils literal">PersistentDB</span> oder <span class="docutils literal">PooledDB</span> übergeben, etwa so:</p>
448+
<pre class="literal-block">from pyodbc import connect
449+
from dbutils.pooled_db import PooledDB
450+
451+
def creator():
452+
con = connect(...)
453+
con.setdecoding(...)
454+
return con
455+
456+
creator.dbapi = pyodbc
457+
458+
db_pool = PooledDB(creator, mincached=5)</pre>
459+
</section>
438460
<section id="anmerkungen">
439461
<h2>Anmerkungen</h2>
440462
<p>Wenn Sie einen der bekannten &quot;Object-Relational Mapper&quot; <a class="reference external" href="http://sqlobject.org/">SQLObject</a> oder
@@ -514,7 +536,7 @@ <h2>Autoren</h2>
514536
</section>
515537
<section id="copyright-und-lizenz">
516538
<h2>Copyright und Lizenz</h2>
517-
<p>Copyright © 2005-2021 Christoph Zwerschke.
539+
<p>Copyright © 2005-2023 Christoph Zwerschke.
518540
Alle Rechte vorbehalten.</p>
519541
<p>DBUtils ist freie und quelloffene Software,
520542
lizenziert unter der <a class="reference external" href="https://opensource.org/licenses/MIT">MIT-Lizenz</a>.</p>

main.html

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33
<head>
4-
<meta charset="utf-8"/>
4+
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
77
<title>DBUtils User's Guide</title>
88
<link rel="stylesheet" href="doc.css" type="text/css" />
99
</head>
@@ -12,7 +12,7 @@
1212
<h1 class="title">DBUtils User's Guide</h1>
1313
<dl class="docinfo simple">
1414
<dt class="version">Version<span class="colon">:</span></dt>
15-
<dd class="version">3.0.2</dd>
15+
<dd class="version">3.0.3</dd>
1616
<dt class="translations">Translations<span class="colon">:</span></dt>
1717
<dd class="translations"><p>English | <a class="reference external" href="main.de.html">German</a></p>
1818
</dd>
@@ -44,12 +44,13 @@ <h1 class="title">DBUtils User's Guide</h1>
4444
<li><p><a class="reference internal" href="#pooleddb-pooled-db-1" id="toc-entry-15">PooledDB (pooled_db)</a></p></li>
4545
</ul>
4646
</li>
47-
<li><p><a class="reference internal" href="#notes" id="toc-entry-16">Notes</a></p></li>
48-
<li><p><a class="reference internal" href="#future" id="toc-entry-17">Future</a></p></li>
49-
<li><p><a class="reference internal" href="#bug-reports-and-feedback" id="toc-entry-18">Bug reports and feedback</a></p></li>
50-
<li><p><a class="reference internal" href="#links" id="toc-entry-19">Links</a></p></li>
51-
<li><p><a class="reference internal" href="#credits" id="toc-entry-20">Credits</a></p></li>
52-
<li><p><a class="reference internal" href="#copyright-and-license" id="toc-entry-21">Copyright and License</a></p></li>
47+
<li><p><a class="reference internal" href="#advanced-usage" id="toc-entry-16">Advanced Usage</a></p></li>
48+
<li><p><a class="reference internal" href="#notes" id="toc-entry-17">Notes</a></p></li>
49+
<li><p><a class="reference internal" href="#future" id="toc-entry-18">Future</a></p></li>
50+
<li><p><a class="reference internal" href="#bug-reports-and-feedback" id="toc-entry-19">Bug reports and feedback</a></p></li>
51+
<li><p><a class="reference internal" href="#links" id="toc-entry-20">Links</a></p></li>
52+
<li><p><a class="reference internal" href="#credits" id="toc-entry-21">Credits</a></p></li>
53+
<li><p><a class="reference internal" href="#copyright-and-license" id="toc-entry-22">Copyright and License</a></p></li>
5354
</ul>
5455
</nav>
5556
<section id="synopsis">
@@ -133,7 +134,7 @@ <h3>Installation</h3>
133134
</section>
134135
<section id="requirements">
135136
<h2>Requirements</h2>
136-
<p>DBUtils supports <a class="reference external" href="https://www.python.org">Python</a> versions 3.6 to 3.10.</p>
137+
<p>DBUtils supports <a class="reference external" href="https://www.python.org">Python</a> versions 3.6 to 3.11.</p>
137138
<p>The modules in the classic PyGreSQL variant need <a class="reference external" href="https://www.pygresql.org/">PyGreSQL</a> version 4.0
138139
or above, while the modules in the universal DB-API 2 variant run with
139140
any Python <a class="reference external" href="https://www.python.org/dev/peps/pep-0249/">DB-API 2</a> compliant database interface module.</p>
@@ -337,7 +338,7 @@ <h3>PooledDB (pooled_db)</h3>
337338
<li><p><span class="docutils literal">setsession</span>: an optional list of SQL commands that may serve to
338339
prepare the session, e.g. <span class="docutils literal">[&quot;set datestyle to german&quot;, <span class="pre">...]</span></span></p></li>
339340
<li><p><span class="docutils literal">reset</span>: how connections should be reset when returned to the pool
340-
(<span class="docutils literal">False</span> or <span class="docutils literal">None</span> to rollback transcations started with <span class="docutils literal">begin()</span>,
341+
(<span class="docutils literal">False</span> or <span class="docutils literal">None</span> to rollback transactions started with <span class="docutils literal">begin()</span>,
341342
the default value <span class="docutils literal">True</span> always issues a rollback for safety's sake)</p></li>
342343
<li><p><span class="docutils literal">failures</span>: an optional exception class or a tuple of exception classes
343344
for which the connection failover mechanism shall be applied,
@@ -396,6 +397,26 @@ <h3>PooledDB (pooled_db)</h3>
396397
back before being given back to the connection pool.</p>
397398
</section>
398399
</section>
400+
<section id="advanced-usage">
401+
<h2>Advanced Usage</h2>
402+
<p>Sometimes you may want to prepare connections before they are used by
403+
DBUtils, in ways that are not possible by just using the right parameters.
404+
For instance, <span class="docutils literal">pyodbc</span> may require to configure connections by calling
405+
the <span class="docutils literal">setencoding()</span> method of the connection. You can do this by passing
406+
a modified <span class="docutils literal">connect()</span> function to <span class="docutils literal">PersistentDB</span> or <span class="docutils literal">PooledDB</span> as
407+
<span class="docutils literal">creator</span> (the first argument), like this:</p>
408+
<pre class="literal-block">from pyodbc import connect
409+
from dbutils.pooled_db import PooledDB
410+
411+
def creator():
412+
con = connect(...)
413+
con.setdecoding(...)
414+
return con
415+
416+
creator.dbapi = pyodbc
417+
418+
db_pool = PooledDB(creator, mincached=5)</pre>
419+
</section>
399420
<section id="notes">
400421
<h2>Notes</h2>
401422
<p>If you are using one of the popular object-relational mappers <a class="reference external" href="http://www.sqlobject.org/">SQLObject</a>
@@ -473,7 +494,7 @@ <h2>Credits</h2>
473494
</section>
474495
<section id="copyright-and-license">
475496
<h2>Copyright and License</h2>
476-
<p>Copyright © 2005-2022 by Christoph Zwerschke.
497+
<p>Copyright © 2005-2023 by Christoph Zwerschke.
477498
All Rights Reserved.</p>
478499
<p>DBUtils is free and open source software,
479500
licensed under the <a class="reference external" href="https://opensource.org/licenses/MIT">MIT license</a>.</p>

0 commit comments

Comments
 (0)