Piccolo

Latest version: v1.5.0

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

Scan your dependencies

Page 18 of 48

0.61.1

Not secure
------

Nicer ASGI template
~~~~~~~~~~~~~~~~~~~

When using ``piccolo asgi new`` to generate a web app, it now has a nicer home
page template, with improved styles.

Improved schema generation
~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixed a bug with ``piccolo schema generate`` where it would crash if the column
type was unrecognised, due to failing to parse the column's default value.
Thanks to gmos for reporting this issue, and figuring out the fix.

Fix Pylance error
~~~~~~~~~~~~~~~~~

Added ``start_connection_pool`` and ``close_connection_pool`` methods to the
base ``Engine`` class (courtesy gmos).

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

0.61.0

Not secure
------

The ``save`` method now supports a ``columns`` argument, so when updating a
row you can specify which values to sync back. For example:

.. code-block:: python

band = await Band.objects().get(Band.name == "Pythonistas")
band.name = "Super Pythonistas"
await band.save([Band.name])

Alternatively, strings are also supported:
await band.save(['name'])

Thanks to trondhindenes for suggesting this feature.

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

0.60.2

Not secure
------

Fixed a bug with ``asyncio.gather`` not working with some query types. It was
due to them being dataclasses, and they couldn't be hashed properly. Thanks to
brnosouza for reporting this issue.

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

0.60.1

Not secure
------

Modified the import path for ``MigrationManager`` in migration files. It was
confusing Pylance (VSCode's type checker). Thanks to gmos for reporting and
investigating this issue.

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

0.60.0

Not secure
------

Secret columns
~~~~~~~~~~~~~~

All column types can now be secret, rather than being limited to the
``Secret`` column type which is a ``Varchar`` under the hood (courtesy
sinisaos).

.. code-block:: python

class Manager(Table):
name = Varchar()
net_worth = Integer(secret=True)

The reason this is useful is you can do queries such as:

.. code-block:: python

>>> Manager.select(exclude_secrets=True).run_sync()
[{'id': 1, 'name': 'Guido'}]

In the Piccolo API project we have ``PiccoloCRUD`` which is an incredibly
powerful way of building an API with very little code. ``PiccoloCRUD`` has an
``exclude_secrets`` option which lets you safely expose your data without
leaking sensitive information.

Pydantic improvements
~~~~~~~~~~~~~~~~~~~~~

max_recursion_depth
*******************

``create_pydantic_model`` now has a ``max_recursion_depth`` argument, which is
useful when using ``nested=True`` on large database schemas.

.. code-block:: python

>>> create_pydantic_model(MyTable, nested=True, max_recursion_depth=3)

Nested tuple
************

You can now pass a tuple of columns as the argument to ``nested``:

.. code-block:: python

>>> create_pydantic_model(Band, nested=(Band.manager,))

This gives you more control than just using ``nested=True``.

include_columns / exclude_columns
*********************************

You can now include / exclude columns from related tables. For example:

.. code-block:: python

>>> create_pydantic_model(Band, nested=(Band.manager,), exclude_columns=(Band.manager.country))

Similarly:

.. code-block:: python

>>> create_pydantic_model(Band, nested=(Band.manager,), include_columns=(Band.name, Band.manager.name))

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

0.59.0

Not secure
------

* When using ``piccolo asgi new`` to generate a FastAPI app, the generated code
is now cleaner. It also contains a ``conftest.py`` file, which encourages
people to use ``piccolo tester run`` rather than using ``pytest`` directly.
* Tidied up docs, and added logo.
* Clarified the use of the ``PICCOLO_CONF`` environment variable in the docs
(courtesy theelderbeever).
* ``create_pydantic_model`` now accepts an ``include_columns`` argument, in
case you only want a few columns in your model, it's faster than using
``exclude_columns`` (courtesy sinisaos).
* Updated linters, and fixed new errors.

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

Page 18 of 48

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.