Skip to content

Releases: piccolo-orm/piccolo

1.7.0

31 May 11:42
Compare
Choose a tag to compare

Arrays of Date / Time / Timestamp / Timestamptz now work in SQLite.

For example:

class MyTable(Table):
    times = Array(Time())
    dates = Array(Date())
    timestamps = Array(Timestamp())
    timestamps_tz = Array(Timestamptz())

1.6.0

30 May 00:06
Compare
Choose a tag to compare

Added support for a bunch of Postgres functions, like Upper, Lower, Length, and Ltrim. They can be used in select queries:

from piccolo.query.functions.string import Upper

>>> await Band.select(Upper(Band.name, alias="name"))
[{"name": "PYTHONISTAS"}]

And also in where clauses:

>>> await Band.select().where(Upper(Band.manager.name) == 'GUIDO')
[{"name": "Pythonistas"}]

1.5.2

28 May 23:03
Compare
Choose a tag to compare

Added an Album table to the playground, along with some other improvements.

Fixed a bug with the output(load_json=True) clause, when used on joined tables.

1.5.1

21 May 11:16
Compare
Choose a tag to compare

Fixed a bug with the CLI when reversing migrations (thanks to @metakot for reporting this).

Updated the ASGI templates (thanks to @tarsil for adding Lilya).

1.5.0

22 Mar 16:59
Compare
Choose a tag to compare

Lots of internal improvements, mostly to support new functionality in Piccolo Admin.

  • docs: Update code example of prefetching related objects by @jrycw in #952
  • 953 Add array_columns to Table._meta by @dantownsend in #954
  • 955 Add a method to the Array column for getting the number of dimensions of the array by @dantownsend in #956
  • 962 Make it clearer how multiple where clauses work in the docs by @dantownsend in #963
  • 964 Remove banner from docs saying about Piccolo v1 by @dantownsend in #965
  • 966 Bump black version by @dantownsend in #967
  • add a unique argument to the column extra by @sinisaos in #968
  • 969 Add a utility method for getting the innermost type of an Array column by @dantownsend in #970
  • update readme for Esmerald by @sinisaos in #972

New Contributors

Full Changelog: 1.4.2...1.5.0

1.4.2

13 Mar 01:07
Compare
Choose a tag to compare

Improved how ModelBuilder handles recursive foreign keys.

1.4.1

12 Mar 22:15
Compare
Choose a tag to compare

Fixed an edge case with auto migrations.

If starting from a table like this, with a custom primary key column:

class MyTable(Table):
    id = UUID(primary_key=True)

When a foreign key is added to the table which references itself:

class MyTable(Table):
    id = UUID(primary_key=True)
    fk = ForeignKey("self")

The auto migrations could fail in some situations.

1.4.0

11 Mar 21:55
Compare
Choose a tag to compare

Improved how create_pydantic_model handles Array columns:

  • Multidimensional arrays (e.g. Array(Array(Integer))) have more accurate types.
  • Array(Email()) now validates that each item in the list is an email address.
  • Array(Varchar(length=10)) now validates that each item is the correct length (i.e. 10 in this example).

Other changes

Some Pylance errors were fixed in the codebase.

1.3.2

04 Mar 12:04
Compare
Choose a tag to compare

Fixed a bug with nested array columns containing BigInt. For example:

class MyTable(Table):
    my_column = Array(Array(BigInt))

Thanks to @AmazingAkai for reporting this issue.

1.3.1

25 Feb 22:42
Compare
Choose a tag to compare

Fixed a bug with foreign keys which reference BigSerial primary keys. Thanks to @Abdelhadi92 for reporting this issue.