Skip to content

Commit c65785f

Browse files
committed
bumped version
1 parent 47806fe commit c65785f

File tree

6 files changed

+79
-3
lines changed

6 files changed

+79
-3
lines changed

CHANGES.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,48 @@
11
Changes
22
=======
33

4+
1.31.0
5+
------
6+
7+
* Added official Postgres 18 support.
8+
* Removed graphlib backport (no longer needed in supported Python versions).
9+
* Improved documentation for column kwargs.
10+
* Updated README to mention other parts of the Piccolo ecosystem (thanks to
11+
@sinisaos for this).
12+
* Table instances can now be compared using the ``==`` operator, and will
13+
return ``True`` if they have the same primary key value (thanks to @aarcex3
14+
and @Skelmis for this).
15+
* Fixed missing import for auto migrations when tables use
16+
``LazyTableReference`` (thanks to @sinisaos for this).
17+
* Improved docs for the auto generated primary key (thanks to @badlydrawnrob
18+
for this).
19+
* Improved ``Table._table_str`` (this is most obvious in the playground, where
20+
the table definitions printed out now show more information - thanks to
21+
@badlydrawnrob for raising this issue).
22+
* Fixed a bug with ``ModelBuilder`` when using ``Array`` columns with
23+
``choices`` defined.
24+
* ``add_m2m`` now returns the id of the joining table row, to match the docs
25+
(thanks to @diklios5768 for reporting this).
26+
* Improved the docs for ``UUID`` columns (what the ``UUID4`` default value
27+
does).
28+
* Moved connection pooling to its own page in the docs.
29+
* Improved the ``on_conflict`` clause - a ``target`` must be specified if
30+
using ``DO UPDATE`` (thanks to @mafuyuuu1 for raising this issue, and
31+
@sinisaos for this fix).
32+
* Changed Esmerald to Ravyn in the ASGI templates (thanks to @sinisaos for
33+
this).
34+
* Fixed a bug with auto migrations when changing a column to a foreign key - an
35+
exception was being raised (thanks to @gsavchuk for raising this issue and
36+
@sinisaos for this fix).
37+
* ``Array(Numeric())`` columns now work with SQLite (thanks to @sinisaos for
38+
this).
39+
* UUID columns now use the built-in ``gen_random_uuid()`` function in Postgres
40+
to generate a default value, instead of using the ``uuid-ossp`` extension
41+
(thanks to @sinisaos for this). See
42+
:ref:`this tutorial <UUIDColumnsMigrationTutorial>` for more details.
43+
44+
-------------------------------------------------------------------------------
45+
446
1.30.0
547
------
648

docs/src/piccolo/engines/sqlite_engine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ Production tips
3030
---------------
3131

3232
If you're planning on using SQLite in production with Piccolo, with lots of
33-
concurrent queries, then here are some :ref:`useful tips <UsingSQLitAndAsyncioEffectively>`.
33+
concurrent queries, then here are some :ref:`useful tips <UsingSQLiteAndAsyncioEffectively>`.

docs/src/piccolo/tutorials/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ help you solve common problems:
1313
./fastapi
1414
./avoiding_circular_imports
1515
./moving_table_between_apps
16+
./uuid_columns_in_piccolo_1.31.0

docs/src/piccolo/tutorials/using_sqlite_and_asyncio_effectively.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _UsingSQLitAndAsyncioEffectively:
1+
.. _UsingSQLiteAndAsyncioEffectively:
22

33
Using SQLite and asyncio effectively
44
====================================
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. _UUIDColumnsMigrationTutorial:
2+
3+
UUID columns in Piccolo >= 1.31.0
4+
=================================
5+
6+
Prior to ``piccolo==1.31.0``, Postgres
7+
:class:`UUID<piccolo.columns.column_types.UUID>` columns generated their
8+
default values using ``uuid_generate_v4()``, which is part of the
9+
``uuid-ossp`` extension.
10+
11+
In all the versions of Posgres that Piccolo supports, there is now a
12+
``gen_random_uuid()`` function built in, which Piccolo now uses for all new
13+
``UUID`` columns for generating default values in the database.
14+
15+
Your existing ``UUID`` columns will be left alone, and will continue to use the
16+
``uuid-ossp`` extension.
17+
18+
Note that :class:`PostgresEngine<piccolo.engine.postgres.PostgresEngine>` has
19+
an ``extensions`` argument. These are Postgres extensions which Piccolo will
20+
try to enable when starting up. This used to include ``uuid-ossp`` by default,
21+
but this is no longer the case. If you want to maintain the old behaviour,
22+
simply do this:
23+
24+
.. code-block:: python
25+
26+
DB = PostgresEngine(extensions=['uuid-ossp'])
27+
28+
If you want to migrate an existing ``UUID`` columns over to use
29+
``gen_random_uuid()`` then run this script:
30+
31+
.. code-block:: sql
32+
33+
ALTER TABLE my_table ALTER COLUMN my_uuid_column SET DEFAULT gen_random_uuid();

piccolo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VERSION__ = "1.30.0"
1+
__VERSION__ = "1.31.0"

0 commit comments

Comments
 (0)