|
1 | 1 | Changes |
2 | 2 | ======= |
3 | 3 |
|
| 4 | +1.33.0 |
| 5 | +------ |
| 6 | + |
| 7 | +UUID v7 |
| 8 | +~~~~~~~ |
| 9 | + |
| 10 | +Added support for UUID v7. |
| 11 | + |
| 12 | +.. code-block:: python |
| 13 | +
|
| 14 | + from piccolo.columns.defaults.uuid import UUID7 |
| 15 | +
|
| 16 | + class MyTable(Table): |
| 17 | + my_column = UUID(default=UUID7()) |
| 18 | +
|
| 19 | +This provides superior insert performance and easier indexing compared to |
| 20 | +UUID v4. |
| 21 | + |
| 22 | +Requires Python 3.14, and Postgres 18 (otherwise extensions are needed). |
| 23 | + |
| 24 | +``Coalesce`` |
| 25 | +~~~~~~~~~~~~ |
| 26 | + |
| 27 | +Added the ``Coalesce`` function - which lets you specify a fall back if a null |
| 28 | +value is found. |
| 29 | + |
| 30 | +For example: |
| 31 | + |
| 32 | +.. code-block:: python |
| 33 | +
|
| 34 | + >>> await Album.select( |
| 35 | + ... Coalesce(Album.release_date, datetime.date(2050, 1, 1)) |
| 36 | + ... ) |
| 37 | +
|
| 38 | +
|
| 39 | +Or you can use this abbreviated syntax: |
| 40 | + |
| 41 | +.. code-block:: python |
| 42 | +
|
| 43 | + >>> await Album.select( |
| 44 | + ... Album.release_date | datetime.date(2050, 1, 1) |
| 45 | + ... ) |
| 46 | +
|
| 47 | +
|
| 48 | +Other changes |
| 49 | +~~~~~~~~~~~~~ |
| 50 | + |
| 51 | +* Fixed a bug with the Piccolo CLI, where custom names for commands weren't |
| 52 | + being applied (thanks to @sinisaos for this and @pelid for reporting the |
| 53 | + issue). |
| 54 | +* Fixed typo in the ``get_related`` docstring (thanks to @nightcityblade for |
| 55 | + this). |
| 56 | +* Fixed bugs with queries when a column has ``db_column_name`` defined (thanks |
| 57 | + to @VladislavYar for raising these issues). |
| 58 | +* Improved the docs for ``Timestamp`` and ``Timestamptz`` columns. |
| 59 | + |
| 60 | +------------------------------------------------------------------------------- |
| 61 | + |
| 62 | +1.32.0 |
| 63 | +------ |
| 64 | + |
| 65 | +Added the ``having`` clause, which is useful when working with ``group_by``. |
| 66 | + |
| 67 | +For example, here we get the number of albums per band, but exclude any bands |
| 68 | +with less than 2 albums: |
| 69 | + |
| 70 | +.. code-block:: python |
| 71 | +
|
| 72 | + >>> from piccolo.query.functions.aggregate import Count |
| 73 | +
|
| 74 | + >>> await Album.select( |
| 75 | + ... Album.band.name.as_alias('band_name'), |
| 76 | + ... Count() |
| 77 | + ... ).group_by( |
| 78 | + ... Album.band |
| 79 | + ... ).having( |
| 80 | + ... Count() >= 2 |
| 81 | + ... ) |
| 82 | +
|
| 83 | + [ |
| 84 | + {"band_name": "Pythonistas", "count": 2}, |
| 85 | + ] |
| 86 | +
|
| 87 | +We also updated our CockroachDB support to the latest version (thanks to |
| 88 | +@sinisaos for this). |
| 89 | + |
| 90 | +------------------------------------------------------------------------------- |
| 91 | + |
4 | 92 | 1.31.0 |
5 | 93 | ------ |
6 | 94 |
|
|
0 commit comments