Skip to content

1.33.0

Latest

Choose a tag to compare

@dantownsend dantownsend released this 06 Mar 17:11
· 1 commit to master since this release

UUID v7

Added support for UUID v7.

from piccolo.columns.defaults.uuid import UUID7

class MyTable(Table):
    my_column = UUID(default=UUID7())

This provides superior insert performance and easier indexing compared to UUID v4.

Requires Python 3.14, and Postgres 18 (otherwise extensions are needed).

Coalesce

Added the Coalesce function - which lets you specify a fall back if a null value is found.

For example:

>>> await Album.select(
...     Coalesce(Album.release_date, datetime.date(2050, 1, 1))
... )

Or you can use this abbreviated syntax:

>>> await Album.select(
...     Album.release_date | datetime.date(2050, 1, 1)
... )

Other changes

  • Fixed a bug with the Piccolo CLI, where custom names for commands weren't being applied (thanks to @sinisaos for this and @pelid for reporting the issue).
  • Fixed typo in the get_related docstring (thanks to @nightcityblade for this).
  • Fixed bugs with queries when a column has db_column_name defined (thanks to @VladislavYar for raising these issues).
  • Improved the docs for Timestamp and Timestamptz columns.