Piccolo

Latest version: v1.22.0

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

Scan your dependencies

Page 18 of 53

0.73.0

Not secure
------

You can now specify extra nodes for a database. For example, if you have a
read replica.

.. code-block:: python

DB = PostgresEngine(
config={'database': 'main_db'},
extra_nodes={
'read_replica_1': PostgresEngine(
config={
'database': 'main_db',
'host': 'read_replica_1.my_db.com'
}
)
}
)

And can then run queries on these other nodes:

.. code-block:: python

>>> await MyTable.select().run(node="read_replica_1")

See `PR 481 <https://github.com/piccolo-orm/piccolo/pull/481>`_. Thanks to
dashsatish for suggesting this feature.

Also, the ``targ`` library has been updated so it tells users about the
``--trace`` argument which can be used to get a full traceback when a CLI
command fails.

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

0.72.0

Not secure
------

Fixed typos with ``drop_constraints``. Courtesy smythp.

Lots of documentation improvements, such as fixing Sphinx's autodoc for the
``Array`` column.

``AppConfig`` now accepts a ``pathlib.Path`` instance. For example:

.. code-block:: python

piccolo_app.py

import pathlib

APP_CONFIG = AppConfig(
app_name="blog",
migrations_folder_path=pathlib.Path(__file__) / "piccolo_migrations"
)

Thanks to theelderbeever for recommending this feature.

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

0.71.1

Not secure
------

Fixed a bug with ``ModelBuilder`` and nullable columns (see `PR 462 <https://github.com/piccolo-orm/piccolo/pull/462>`_).
Thanks to fiolet069 for reporting this issue.

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

0.71.0

Not secure
------

The ``ModelBuilder`` class, which is used to generate mock data in tests, now
supports ``Array`` columns. Courtesy backwardspy.

Lots of internal code optimisations and clean up. Courtesy yezz123.

Added docs for troubleshooting common MyPy errors.

Also thanks to adriangb for helping us with our dependency issues.

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

0.70.1

Not secure
------

Fixed a bug with auto migrations. If renaming multiple columns at once, it
could get confused. Thanks to theelderbeever for reporting this issue, and
sinisaos for helping to replicate it. See `PR 457 <https://github.com/piccolo-orm/piccolo/pull/457>`_.

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

0.70.0

Not secure
------

We ran a profiler on the Piccolo codebase and identified some optimisations.
For example, we were calling ``self.querystring`` multiple times in a method,
rather than assigning it to a local variable.

We also ran a linter which identified when list / set / dict comprehensions
could be more efficient.

The performance is now slightly improved (especially when fetching large
numbers of rows from the database).

Example query times on a MacBook, when fetching 1000 rows from a local Postgres
database (using ``await SomeTable.select()``):

* 8 ms without a connection pool
* 2 ms with a connection pool

As you can see, having a connection pool is the main thing you can do to
improve performance.

Thanks to AliSayyah for all his work on this.

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

Page 18 of 53

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.