Skip to content

Releases: piccolo-orm/piccolo

0.74.1

Choose a tag to compare

@dantownsend dantownsend released this 23 Apr 08:35

When using pip install piccolo[all] on Windows it would fail because uvloop isn't supported. Thanks to @jack1142 for reporting this issue.

0.74.0

Choose a tag to compare

@dantownsend dantownsend released this 13 Apr 20:49

We've had the ability to bulk modify rows for a while. Here we append '!!!' to each band's name:

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

It only worked for some columns - Varchar, Text, Integer etc.

We now allow Date, Timestamp, Timestamptz and Interval columns to be bulk modified using a timedelta. Here we modify each concert's start date, so it's one day later:

>>> await Concert.update(
...     {Concert.starts: Concert.starts + timedelta(days=1)},
...     force=True
... )

Thanks to @theelderbeever for suggesting this feature.

0.73.0

Choose a tag to compare

@dantownsend dantownsend released this 08 Apr 16:37

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

  DB = PostgresEngine(
      config={'database': 'main_db', 'host': 'prod.my_db.com'},
      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:

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

See PR 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

Choose a tag to compare

@dantownsend dantownsend released this 30 Mar 09:32

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:

# 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

Choose a tag to compare

@dantownsend dantownsend released this 13 Mar 08:35

Fixed a bug with ModelBuilder and nullable columns (see PR 462). Thanks to @fiolet069 for reporting this issue.

0.71.0

Choose a tag to compare

@dantownsend dantownsend released this 11 Mar 20:13

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

Choose a tag to compare

@dantownsend dantownsend released this 09 Mar 10:02

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.

0.70.0

Choose a tag to compare

@dantownsend dantownsend released this 08 Mar 00:24

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.

0.69.5

Choose a tag to compare

@dantownsend dantownsend released this 06 Mar 23:27

Made improvements to piccolo schema generate, which automatically generates Piccolo Table classes from an existing database.

There were situations where it would fail ungracefully when it couldn't parse an index definition. It no longer crashes, and we print out the problematic index definitions. See PR 449. Thanks to @gmos for originally reporting this issue.

We also improved the error messages if schema generation fails for some reason by letting the user know which table caused the error. Courtesy @AliSayyah.

0.69.4

Choose a tag to compare

@dantownsend dantownsend released this 05 Mar 11:00

We used to raise a ValueError if a column was both null=False and default=None. This has now been removed, as there are situations where it's valid for columns to be configured that way. Thanks to @gmos for suggesting this change.