Skip to content

Releases: huntfx/ftrack-query

Bug fixes and custom exceptions

09 Feb 18:10
Compare
Choose a tag to compare

Improvements

  • Raises UnboundSessionError if attempting to execute a query with no attached session.

Fixes

  • Fix error when using in_() without any arguments or with an empty generator.

Change component cleanup method to an option

10 Oct 13:41
Compare
Choose a tag to compare

Changes

  • The clean_components() method has been moved to .options(remove_components=True)

Fix bug when reusing create statements

10 Oct 10:42
Compare
Choose a tag to compare

Fixes

  • Fix bug where reusing create statements would result in duplicate values.

Improved statements

30 Aug 10:39
Compare
Choose a tag to compare

Features

  • Add attr function to use with comparisons (attr('x.y') is replacing entity.x.y)
  • Add .options() method on queries to set the page size or attach a new session
  • Add FTRACK_API_PAGE_SIZE environment variable to set the page size globally, and a page_size parameter to FTrackQuery() to set it for the entire session
  • Add session.select() as shorthand for session.execute(select())

Improvements

  • .in_() now supports any data types
  • Generators are now automatically unpacked when passed to in_()
  • Subqueries will not attempt to remap any values (it was confusing behaviour)

New statement syntax

06 Jun 10:43
Compare
Choose a tag to compare

Features

  • Added select, update, delete and create statements to work in a similar way to SQLAlchemy.
  • Rewrote subquery support - subqueries will be used when the API allows for it, otherwise an error will be raised (the old way would automatically execute the query).

Improvements

  • Add a clean_components() method when building a delete statement, which will automatically remove matching components from every location.
  • Stop automatically executing the query when checking for truthiness.
  • Allow the use of order_by for sorting, and also accept asc/desc as strings.
  • Added a contains method, which is the equivelant of .like(f'%{val}%').

Automatically execute query objects in comparisons

21 Jun 12:26
Compare
Choose a tag to compare

Improvements

  • Any query objects passed into comparisons will now be executed.
    The following is now valid:
    session.Episode.where(project=query) - Executes query.one().
    session.Episode.where(entity.project == query) - Executes query.one().
    session.Episode.where(entity.project.in_(query)) - Executes query.all().
    session.Episode.where(entity.project.in_(query, query)) - Executes query.one() on each.

Improve populate behaviour

22 Apr 16:33
Compare
Choose a tag to compare

Improvements

  • Accept lists in populate function - session.populate(item, (entity.name, entity.project.name)) is now valid

Improvement to primary key query

15 Feb 13:00
Compare
Choose a tag to compare

Fixes

  • If the primary key query finds multiple entities with different capitalisation, return the one exactly matching the input

Remove ftrack_api modules as class attributes

12 Feb 11:18
Compare
Choose a tag to compare

Changes

  • Remove FTrackQuery.exc (ftrack_api.exception)
  • Remove FTrackQuery.symbol (ftrack_api.symbol)
  • Remove FTrackQuery.Entity (ftrack_api.entity.base.Entity)

Minor improvements

11 Feb 18:07
Compare
Choose a tag to compare

Features

  • Add startswith() and endswith() operators

Changes

  • Added error message if attempting to use __contains__().
  • Increase number of pre-defined primary keys

Fixes

  • Fix error if no arguments are passed to in_()