Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: aiopg
3 Version: 1.5.0a1
4 Summary: Postgres integration with asyncio.
5 Home-page: https://aiopg.readthedocs.io
6 Author: Andrew Svetlov
7 Author-email: [email protected]
8 Maintainer: Andrew Svetlov <[email protected]>, Alexey Firsov <[email protected]>, Alexey Popravka <[email protected]>, Yury Pliner <[email protected]>
9 Maintainer-email: [email protected]
10 License: BSD
11 Download-URL: https://pypi.python.org/pypi/aiopg
12 Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby
13 Project-URL: CI: GA, https://github.com/aio-libs/aiopg/actions?query=workflow%3ACI
14 Project-URL: Coverage: codecov, https://codecov.io/gh/aio-libs/aiopg
15 Project-URL: Docs: RTD, https://aiopg.readthedocs.io
16 Project-URL: GitHub: issues, https://github.com/aio-libs/aiopg/issues
17 Project-URL: GitHub: repo, https://github.com/aio-libs/aiopg
18 Platform: macOS
19 Platform: POSIX
20 Platform: Windows
21 Classifier: License :: OSI Approved :: BSD License
22 Classifier: Intended Audience :: Developers
23 Classifier: Programming Language :: Python :: 3
24 Classifier: Programming Language :: Python :: 3 :: Only
25 Classifier: Programming Language :: Python :: 3.7
26 Classifier: Programming Language :: Python :: 3.8
27 Classifier: Programming Language :: Python :: 3.9
28 Classifier: Programming Language :: Python :: 3.10
29 Classifier: Programming Language :: Python :: 3.11
30 Classifier: Operating System :: POSIX
31 Classifier: Operating System :: MacOS :: MacOS X
32 Classifier: Operating System :: Microsoft :: Windows
33 Classifier: Environment :: Web Environment
34 Classifier: Development Status :: 5 - Production/Stable
35 Classifier: Topic :: Database
36 Classifier: Topic :: Database :: Front-Ends
37 Classifier: Framework :: AsyncIO
38 Requires-Python: >=3.7
39 Description-Content-Type: text/x-rst
40 Provides-Extra: sa
41 License-File: LICENSE
42
43 aiopg
44 =====
45 .. image:: https://github.com/aio-libs/aiopg/workflows/CI/badge.svg
46 :target: https://github.com/aio-libs/aiopg/actions?query=workflow%3ACI
47 .. image:: https://codecov.io/gh/aio-libs/aiopg/branch/master/graph/badge.svg
48 :target: https://codecov.io/gh/aio-libs/aiopg
49 .. image:: https://badges.gitter.im/Join%20Chat.svg
50 :target: https://gitter.im/aio-libs/Lobby
51 :alt: Chat on Gitter
52
53 **aiopg** is a library for accessing a PostgreSQL_ database
54 from the asyncio_ (PEP-3156/tulip) framework. It wraps
55 asynchronous features of the Psycopg database driver.
56
57 Example
58 -------
59
60 .. code:: python
61
62 import asyncio
63 import aiopg
64
65 dsn = 'dbname=aiopg user=aiopg password=passwd host=127.0.0.1'
66
67 async def go():
68 pool = await aiopg.create_pool(dsn)
69 async with pool.acquire() as conn:
70 async with conn.cursor() as cur:
71 await cur.execute("SELECT 1")
72 ret = []
73 async for row in cur:
74 ret.append(row)
75 assert ret == [(1,)]
76
77 loop = asyncio.get_event_loop()
78 loop.run_until_complete(go())
79
80
81 Example of SQLAlchemy optional integration
82 ------------------------------------------
83
84 .. code:: python
85
86 import asyncio
87 from aiopg.sa import create_engine
88 import sqlalchemy as sa
89
90 metadata = sa.MetaData()
91
92 tbl = sa.Table('tbl', metadata,
93 sa.Column('id', sa.Integer, primary_key=True),
94 sa.Column('val', sa.String(255)))
95
96 async def create_table(engine):
97 async with engine.acquire() as conn:
98 await conn.execute('DROP TABLE IF EXISTS tbl')
99 await conn.execute('''CREATE TABLE tbl (
100 id serial PRIMARY KEY,
101 val varchar(255))''')
102
103 async def go():
104 async with create_engine(user='aiopg',
105 database='aiopg',
106 host='127.0.0.1',
107 password='passwd') as engine:
108
109 async with engine.acquire() as conn:
110 await conn.execute(tbl.insert().values(val='abc'))
111
112 async for row in conn.execute(tbl.select()):
113 print(row.id, row.val)
114
115 loop = asyncio.get_event_loop()
116 loop.run_until_complete(go())
117
118 .. _PostgreSQL: http://www.postgresql.org/
119 .. _asyncio: https://docs.python.org/3/library/asyncio.html
120
121 Please use::
122
123 $ make test
124
125 for executing the project's unittests.
126 See https://aiopg.readthedocs.io/en/stable/contributing.html for details
127 on how to set up your environment to run the tests.
128
129 Changelog
130 ---------
131
132 1.5.0a1 (2023-08-29)
133 ^^^^^^^^^^^^^^^^^^^^
134
135 * SQLAlchemy 2.0 compatibility `#901 <https://github.com/aio-libs/aiopg/pull/901>`_
136
137
138 1.4.0 (2022-10-26)
139 ^^^^^^^^^^^^^^^^^^
140
141 * Add python 3.11 and drop python 3.6 support `#892 <https://github.com/aio-libs/aiopg/pull/892>`_
142
143
144 1.3.5 (2022-09-25)
145 ^^^^^^^^^^^^^^^^^^
146
147 * Fix pool size limit check for unlimited pools `#888 <https://github.com/aio-libs/aiopg/pull/888>`_
148
149
150 1.3.4 (2022-06-30)
151 ^^^^^^^^^^^^^^^^^^
152
153
154 1.3.4b3 (2022-06-29)
155 ^^^^^^^^^^^^^^^^^^^^
156
157
158 1.3.4b2 (2022-06-29)
159 ^^^^^^^^^^^^^^^^^^^^
160
161
162 1.3.4b1 (2022-06-29)
163 ^^^^^^^^^^^^^^^^^^^^
164
165 * Fix compatibility with SA 1.4.38 `#891 <https://github.com/aio-libs/aiopg/pull/891>`_
166 * Add py.typed marker `#878 <https://github.com/aio-libs/aiopg/pull/878>`_
167
168
169 1.3.3 (2021-11-01)
170 ^^^^^^^^^^^^^^^^^^
171
172 * Support async-timeout 4.0+
173
174
175 1.3.2 (2021-10-07)
176 ^^^^^^^^^^^^^^^^^^
177
178
179 1.3.2b2 (2021-10-07)
180 ^^^^^^^^^^^^^^^^^^^^
181
182 * Respect use_labels for select statement `#882 <https://github.com/aio-libs/aiopg/pull/882>`_
183
184
185 1.3.2b1 (2021-07-11)
186 ^^^^^^^^^^^^^^^^^^^^
187
188 * Fix compatibility with SQLAlchemy >= 1.4 `#870 <https://github.com/aio-libs/aiopg/pull/870>`_
189
190
191 1.3.1 (2021-07-08)
192 ^^^^^^^^^^^^^^^^^^
193
194
195 1.3.1b2 (2021-07-06)
196 ^^^^^^^^^^^^^^^^^^^^
197
198 * Suppress "Future exception was never retrieved" `#862 <https://github.com/aio-libs/aiopg/pull/862>`_
199
200
201 1.3.1b1 (2021-07-05)
202 ^^^^^^^^^^^^^^^^^^^^
203
204 * Fix ClosableQueue.get on cancellation, close it on Connection.close `#859 <https://github.com/aio-libs/aiopg/pull/859>`_
205
206
207 1.3.0 (2021-06-30)
208 ^^^^^^^^^^^^^^^^^^
209
210
211 1.3.0b4 (2021-06-28)
212 ^^^^^^^^^^^^^^^^^^^^
213
214 * Fix "Unable to detect disconnect when using NOTIFY/LISTEN" `#559 <https://github.com/aio-libs/aiopg/pull/559>`_
215
216
217 1.3.0b3 (2021-04-03)
218 ^^^^^^^^^^^^^^^^^^^^
219
220 * Reformat using black `#814 <https://github.com/aio-libs/aiopg/pull/814>`_
221
222
223 1.3.0b2 (2021-04-02)
224 ^^^^^^^^^^^^^^^^^^^^
225
226 * Type annotations `#813 <https://github.com/aio-libs/aiopg/pull/813>`_
227
228
229 1.3.0b1 (2021-03-30)
230 ^^^^^^^^^^^^^^^^^^^^
231
232 * Raise ResourceClosedError if we try to open a cursor on a closed SAConnection `#811 <https://github.com/aio-libs/aiopg/pull/811>`_
233
234
235 1.3.0b0 (2021-03-25)
236 ^^^^^^^^^^^^^^^^^^^^
237
238 * Fix compatibility with SA 1.4 for IN statement `#806 <https://github.com/aio-libs/aiopg/pull/806>`_
239
240
241 1.2.1 (2021-03-23)
242 ^^^^^^^^^^^^^^^^^^
243
244 * Pop loop in connection init due to backward compatibility `#808 <https://github.com/aio-libs/aiopg/pull/808>`_
245
246
247 1.2.0b4 (2021-03-23)
248 ^^^^^^^^^^^^^^^^^^^^
249
250 * Set max supported sqlalchemy version `#805 <https://github.com/aio-libs/aiopg/pull/805>`_
251
252
253 1.2.0b3 (2021-03-22)
254 ^^^^^^^^^^^^^^^^^^^^
255
256 * Don't run ROLLBACK when the connection is closed `#778 <https://github.com/aio-libs/aiopg/pull/778>`_
257
258 * Multiple cursors support `#801 <https://github.com/aio-libs/aiopg/pull/801>`_
259
260
261 1.2.0b2 (2020-12-21)
262 ^^^^^^^^^^^^^^^^^^^^
263
264 * Fix IsolationLevel.read_committed and introduce IsolationLevel.default `#770 <https://github.com/aio-libs/aiopg/pull/770>`_
265
266 * Fix python 3.8 warnings in tests `#771 <https://github.com/aio-libs/aiopg/pull/771>`_
267
268
269 1.2.0b1 (2020-12-16)
270 ^^^^^^^^^^^^^^^^^^^^
271
272 * Deprecate blocking connection.cancel() method `#570 <https://github.com/aio-libs/aiopg/pull/570>`_
273
274
275 1.2.0b0 (2020-12-15)
276 ^^^^^^^^^^^^^^^^^^^^
277
278 * Implement timeout on acquiring connection from pool `#766 <https://github.com/aio-libs/aiopg/pull/766>`_
279
280
281 1.1.0 (2020-12-10)
282 ^^^^^^^^^^^^^^^^^^
283
284
285 1.1.0b2 (2020-12-09)
286 ^^^^^^^^^^^^^^^^^^^^
287
288 * Added missing slots to context managers `#763 <https://github.com/aio-libs/aiopg/pull/763>`_
289
290
291 1.1.0b1 (2020-12-07)
292 ^^^^^^^^^^^^^^^^^^^^
293
294 * Fix on_connect multiple call on acquire `#552 <https://github.com/aio-libs/aiopg/pull/552>`_
295
296 * Fix python 3.8 warnings `#622 <https://github.com/aio-libs/aiopg/pull/642>`_
297
298 * Bump minimum psycopg version to 2.8.4 `#754 <https://github.com/aio-libs/aiopg/pull/754>`_
299
300 * Fix Engine.release method to release connection in any way `#756 <https://github.com/aio-libs/aiopg/pull/756>`_
301
302
303 1.0.0 (2019-09-20)
304 ^^^^^^^^^^^^^^^^^^
305
306 * Removal of an asynchronous call in favor of issues # 550
307
308 * Big editing of documentation and minor bugs #534
309
310
311 0.16.0 (2019-01-25)
312 ^^^^^^^^^^^^^^^^^^^
313
314 * Fix select priority name `#525 <https://github.com/aio-libs/aiopg/issues/525>`_
315
316 * Rename `psycopg2` to `psycopg2-binary` to fix deprecation warning `#507 <https://github.com/aio-libs/aiopg/issues/507>`_
317
318 * Fix `#189 <https://github.com/aio-libs/aiopg/issues/189>`_ hstore when using ReadDictCursor `#512 <https://github.com/aio-libs/aiopg/issues/512>`_
319
320 * close cannot be used while an asynchronous query is underway `#452 <https://github.com/aio-libs/aiopg/issues/452>`_
321
322 * sqlalchemy adapter trx begin allow transaction_mode `#498 <https://github.com/aio-libs/aiopg/issues/498>`_
323
324
325 0.15.0 (2018-08-14)
326 ^^^^^^^^^^^^^^^^^^^
327
328 * Support Python 3.7 `#437 <https://github.com/aio-libs/aiopg/issues/437>`_
329
330
331 0.14.0 (2018-05-10)
332 ^^^^^^^^^^^^^^^^^^^
333
334 * Add ``get_dialect`` func to have ability to pass ``json_serializer`` `#451 <https://github.com/aio-libs/aiopg/issues/451>`_
335
336
337 0.13.2 (2018-01-03)
338 ^^^^^^^^^^^^^^^^^^^
339
340 * Fixed compatibility with SQLAlchemy 1.2.0 `#412 <https://github.com/aio-libs/aiopg/issues/412>`_
341
342 * Added support for transaction isolation levels `#219 <https://github.com/aio-libs/aiopg/issues/219>`_
343
344
345 0.13.1 (2017-09-10)
346 ^^^^^^^^^^^^^^^^^^^
347
348 * Added connection poll recycling logic `#373 <https://github.com/aio-libs/aiopg/issues/373>`_
349
350
351 0.13.0 (2016-12-02)
352 ^^^^^^^^^^^^^^^^^^^
353
354 * Add `async with` support to `.begin_nested()` `#208 <https://github.com/aio-libs/aiopg/issues/208>`_
355
356 * Fix connection.cancel() `#212 <https://github.com/aio-libs/aiopg/issues/212>`_ `#223 <https://github.com/aio-libs/aiopg/issues/223>`_
357
358 * Raise informative error on unexpected connection closing `#191 <https://github.com/aio-libs/aiopg/issues/191>`_
359
360 * Added support for python types columns issues `#217 <https://github.com/aio-libs/aiopg/issues/217>`_
361
362 * Added support for default values in SA table issues `#206 <https://github.com/aio-libs/aiopg/issues/206>`_
363
364
365 0.12.0 (2016-10-09)
366 ^^^^^^^^^^^^^^^^^^^
367
368 * Add an on_connect callback parameter to pool `#141 <https://github.com/aio-libs/aiopg/issues/141>`_
369
370 * Fixed connection to work under both windows and posix based systems `#142 <https://github.com/aio-libs/aiopg/issues/142>`_
371
372
373 0.11.0 (2016-09-12)
374 ^^^^^^^^^^^^^^^^^^^
375
376 * Immediately remove callbacks from a closed file descriptor `#139 <https://github.com/aio-libs/aiopg/issues/139>`_
377
378 * Drop Python 3.3 support
379
380
381 0.10.0 (2016-07-16)
382 ^^^^^^^^^^^^^^^^^^^
383
384 * Refactor tests to use dockerized Postgres server `#107 <https://github.com/aio-libs/aiopg/issues/107>`_
385
386 * Reduce default pool minsize to 1 `#106 <https://github.com/aio-libs/aiopg/issues/106>`_
387
388 * Explicitly enumerate packages in setup.py `#85 <https://github.com/aio-libs/aiopg/issues/85>`_
389
390 * Remove expired connections from pool on acquire `#116 <https://github.com/aio-libs/aiopg/issues/116>`_
391
392 * Don't crash when Connection is GC'ed `#124 <https://github.com/aio-libs/aiopg/issues/124>`_
393
394 * Use loop.create_future() if available
395
396
397 0.9.2 (2016-01-31)
398 ^^^^^^^^^^^^^^^^^^
399
400 * Make pool.release return asyncio.Future, so we can wait on it in
401 `__aexit__` `#102 <https://github.com/aio-libs/aiopg/issues/102>`_
402
403 * Add support for uuid type `#103 <https://github.com/aio-libs/aiopg/issues/103>`_
404
405
406 0.9.1 (2016-01-17)
407 ^^^^^^^^^^^^^^^^^^
408
409 * Documentation update `#101 <https://github.com/aio-libs/aiopg/issues/101>`_
410
411
412 0.9.0 (2016-01-14)
413 ^^^^^^^^^^^^^^^^^^
414
415 * Add async context managers for transactions `#91 <https://github.com/aio-libs/aiopg/issues/91>`_
416
417 * Support async iterator in ResultProxy `#92 <https://github.com/aio-libs/aiopg/issues/92>`_
418
419 * Add async with for engine `#90 <https://github.com/aio-libs/aiopg/issues/90>`_
420
421
422 0.8.0 (2015-12-31)
423 ^^^^^^^^^^^^^^^^^^
424
425 * Add PostgreSQL notification support `#58 <https://github.com/aio-libs/aiopg/issues/58>`_
426
427 * Support pools with unlimited size `#59 <https://github.com/aio-libs/aiopg/issues/59>`_
428
429 * Cancel current DB operation on asyncio timeout `#66 <https://github.com/aio-libs/aiopg/issues/66>`_
430
431 * Add async with support for Pool, Connection, Cursor `#88 <https://github.com/aio-libs/aiopg/issues/88>`_
432
433
434 0.7.0 (2015-04-22)
435 ^^^^^^^^^^^^^^^^^^
436
437 * Get rid of resource leak on connection failure.
438
439 * Report ResourceWarning on non-closed connections.
440
441 * Deprecate iteration protocol support in cursor and ResultProxy.
442
443 * Release sa connection to pool on `connection.close()`.
444
445
446 0.6.0 (2015-02-03)
447 ^^^^^^^^^^^^^^^^^^
448
449 * Accept dict, list, tuple, named and positional parameters in
450 `SAConnection.execute()`
451
452
453 0.5.2 (2014-12-08)
454 ^^^^^^^^^^^^^^^^^^
455
456 * Minor release, fixes a bug that leaves connection in broken state
457 after `cursor.execute()` failure.
458
459
460 0.5.1 (2014-10-31)
461 ^^^^^^^^^^^^^^^^^^
462
463 * Fix a bug for processing transactions in line.
464
465
466 0.5.0 (2014-10-31)
467 ^^^^^^^^^^^^^^^^^^
468
469 * Add .terminate() to Pool and Engine
470
471 * Reimplement connection pool (now pool size cannot be greater than pool.maxsize)
472
473 * Add .close() and .wait_closed() to Pool and Engine
474
475 * Add minsize, maxsize, size and freesize properties to sa.Engine
476
477 * Support *echo* parameter for logging executed SQL commands
478
479 * Connection.close() is not a coroutine (but we keep backward compatibility).
480
481
482 0.4.1 (2014-10-02)
483 ^^^^^^^^^^^^^^^^^^
484
485 * make cursor iterable
486
487 * update docs
488
489
490 0.4.0 (2014-10-02)
491 ^^^^^^^^^^^^^^^^^^
492
493 * add timeouts for database operations.
494
495 * Autoregister psycopg2 support for json data type.
496
497 * Support JSON in aiopg.sa
498
499 * Support ARRAY in aiopg.sa
500
501 * Autoregister hstore support if present in connected DB
502
503 * Support HSTORE in aiopg.sa
504
505
506 0.3.2 (2014-07-07)
507 ^^^^^^^^^^^^^^^^^^
508
509 * change signature to cursor.execute(operation, parameters=None) to
510 follow psycopg2 convention.
511
512
513 0.3.1 (2014-07-04)
514 ^^^^^^^^^^^^^^^^^^
515
516 * Forward arguments to cursor constructor for pooled connections.
517
518
519 0.3.0 (2014-06-22)
520 ^^^^^^^^^^^^^^^^^^
521
522 * Allow executing SQLAlchemy DDL statements.
523
524 * Fix bug with race conditions on acquiring/releasing connections from pool.
525
526
527 0.2.3 (2014-06-12)
528 ^^^^^^^^^^^^^^^^^^
529
530 * Fix bug in connection pool.
531
532
533 0.2.2 (2014-06-07)
534 ^^^^^^^^^^^^^^^^^^
535
536 * Fix bug with passing parameters into SAConnection.execute when
537 executing raw SQL expression.
538
539
540 0.2.1 (2014-05-08)
541 ^^^^^^^^^^^^^^^^^^
542
543 * Close connection with invalid transaction status on returning to pool.
544
545
546 0.2.0 (2014-05-04)
547 ^^^^^^^^^^^^^^^^^^
548
549 * Implemented optional support for sqlalchemy functional sql layer.
550
551
552 0.1.0 (2014-04-06)
553 ^^^^^^^^^^^^^^^^^^
554
555 * Implemented plain connections: connect, Connection, Cursor.
556
557 * Implemented database pools: create_pool and Pool.
558