Piccolo

Latest version: v1.5.0

Safety actively analyzes 626941 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 15 of 48

0.69.3

Not secure
------

The ``where`` clause now raises a ``ValueError`` if a boolean value is
passed in by accident. This was possible in the following situation:

.. code-block:: python

await Band.select().where(Band.has_drummer is None)

Piccolo can't override the ``is`` operator because Python doesn't allow it,
so ``Band.has_drummer is None`` will always equal ``False``. Thanks to
trondhindenes for reporting this issue.

We've also put a lot of effort into improving documentation throughout the
project.

-------------------------------------------------------------------------------

0.69.2

Not secure
------

* Lots of documentation improvements, including how to customise ``BaseUser``
(courtesy sinisaos).
* Fixed a bug with creating indexes when the column name clashes with a SQL
keyword (e.g. ``'order'``). See `Pr 433 <https://github.com/piccolo-orm/piccolo/pull/433>`_.
Thanks to wmshort for reporting this issue.
* Fixed an issue where some slots were incorrectly configured (courtesy
ariebovenberg). See `PR 426 <https://github.com/piccolo-orm/piccolo/pull/426>`_.

-------------------------------------------------------------------------------

0.69.1

Not secure
------

Fixed a bug with auto migrations which rename columns - see
`PR 423 <https://github.com/piccolo-orm/piccolo/pull/423>`_. Thanks to
theelderbeever for reporting this, and sinisaos for help investigating.

-------------------------------------------------------------------------------

0.69.0

Not secure
------

Added `Xpresso <https://xpresso-api.dev/>`_ as a supported ASGI framework when
using ``piccolo asgi new`` to generate a web app.

Thanks to sinisaos for adding this template, and adriangb for reviewing.

We also took this opportunity to update our FastAPI and BlackSheep ASGI
templates.

-------------------------------------------------------------------------------

0.68.0

Not secure
------

``Update`` queries without a ``where`` clause
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you try and perform an update query without a ``where`` clause you will now
get an error:

.. code-block:: python

>>> await Band.update({Band.name: 'New Band'})
UpdateError

If you want to update all rows in the table, you can still do so, but you must
pass ``force=True``.

.. code-block:: python

>>> await Band.update({Band.name: 'New Band'}, force=True)

This is a similar to ``delete`` queries, which require a ``where`` clause or
``force=True``.

It was pointed out by theelderbeever that an accidental mass update is almost
as bad as a mass deletion, which is why this safety measure has been added.

See `PR 412 <https://github.com/piccolo-orm/piccolo/pull/412>`_.

.. warning:: This is a breaking change. It you're doing update queries without
a where clause, you will need to add ``force=True``.

``JSONB`` improvements
~~~~~~~~~~~~~~~~~~~~~~

Fixed some bugs with nullable ``JSONB`` columns. A value of ``None`` is now
stored as ``null`` in the database, instead of the JSON string ``'null'``.
Thanks to theelderbeever for reporting this.

See `PR 413 <https://github.com/piccolo-orm/piccolo/pull/413>`_.

-------------------------------------------------------------------------------

0.67.0

Not secure
------

create_user
~~~~~~~~~~~

``BaseUser`` now has a ``create_user`` method, which adds some extra password
validation vs just instantiating and saving ``BaseUser`` directly.

.. code-block:: python

>>> await BaseUser.create_user(username='bob', password='abc123XYZ')
<BaseUser: 1>

We check that passwords are a reasonable length, and aren't already hashed.
See `PR 402 <https://github.com/piccolo-orm/piccolo/pull/402>`_.

async first
~~~~~~~~~~~

All of the docs have been updated to show the async version of queries.

For example:

.. code-block:: python

Previous:
Band.select().run_sync()

Now:
await Band.select()

Most people use Piccolo in async apps, and the playground supports top level
await, so you can just paste in ``await Band.select()`` and it will still work.
See `PR 407 <https://github.com/piccolo-orm/piccolo/pull/407>`_.

We decided to use ``await Band.select()`` instead of ``await Band.select().run()``.
Both work, and have their merits, but the simpler version is probably easier
for newcomers.

-------------------------------------------------------------------------------

Page 15 of 48

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.