Commit db4f1a6
committed
Allow using custom Record class
Add the new `record_class` parameter to the `create_pool()` and
`connect()` functions, as well as to the `cursor()`, `prepare()`,
`fetch()` and `fetchrow()` connection methods.
This not only allows adding custom functionality to the returned
objects, but also assists with typing (see #577 for discussion).
Fixes: #40.1 parent c8b8a50 commit db4f1a6Copy full SHA for db4f1a6
File tree
Expand file treeCollapse file tree
17 files changed
+610
-105
lines changedOpen diff view settings
Filter options
- asyncpg
- _testbase
- protocol
- codecs
- record
- tests
Expand file treeCollapse file tree
17 files changed
+610
-105
lines changedOpen diff view settings
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | | - |
| 2 | + |
3 | 3 | |
Collapse file
asyncpg/_testbase/__init__.py
Copy file name to clipboardExpand all lines: asyncpg/_testbase/__init__.py+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
19 | 19 | |
20 | 20 | |
21 | 21 | |
| 22 | + |
22 | 23 | |
23 | 24 | |
24 | 25 | |
| ||
266 | 267 | |
267 | 268 | |
268 | 269 | |
| 270 | + |
269 | 271 | |
270 | 272 | |
271 | 273 | |
272 | 274 | |
273 | 275 | |
274 | 276 | |
275 | 277 | |
| 278 | + |
276 | 279 | |
277 | 280 | |
278 | 281 | |
|
Collapse file
+20-7Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
594 | 594 | |
595 | 595 | |
596 | 596 | |
597 | | - |
598 | | - |
| 597 | + |
| 598 | + |
| 599 | + |
| 600 | + |
| 601 | + |
| 602 | + |
| 603 | + |
| 604 | + |
| 605 | + |
| 606 | + |
599 | 607 | |
600 | 608 | |
601 | 609 | |
| ||
613 | 621 | |
614 | 622 | |
615 | 623 | |
616 | | - |
| 624 | + |
617 | 625 | |
618 | 626 | |
619 | 627 | |
| ||
649 | 657 | |
650 | 658 | |
651 | 659 | |
652 | | - |
| 660 | + |
653 | 661 | |
654 | 662 | |
655 | 663 | |
| ||
661 | 669 | |
662 | 670 | |
663 | 671 | |
664 | | - |
665 | | - |
666 | | - |
| 672 | + |
| 673 | + |
| 674 | + |
| 675 | + |
| 676 | + |
| 677 | + |
| 678 | + |
| 679 | + |
667 | 680 | |
668 | 681 | |
669 | 682 | |
|
0 commit comments