Skip to content

Releases: vapor/fluent-kit

Complex join conditions and composite-key parent relations

07 Feb 11:22
d03b0ff

Choose a tag to compare

This patch was authored and released by @gwynne.

This release includes significant feature additions, cleanups, and improvements:

  • More complex conditions are now supported when using .join() in queries; the != operator is now supported, and conditions may be combined using &&.
  • The new @CompositeParent property type may be used to reference a model which uses @CompositeID as the parent of another model.
  • ModelAlias now works in most cases that were previously broken; among other cases, it is now possible to alias models which specify a space.
  • The poorly-considered "duplicate" SQLList type previously available in FluentSQL is now deprecated; use SQLKit's version instead.
  • Various code cleanups and minor performance improvements.
  • Fields and ModelAlias now have detailed code documentation.
  • A new type, SomeCodingKey, is now available, providing a complete implementation of CodingKey for convenience in various cases when arbitrary string or integer keys are desired.
  • The SQL generated by FluentKit queries should now be slightly more consistent.

Fix support for composite ID models with QueryBuilder.count()

04 Nov 08:52
be7912e

Choose a tag to compare

This patch was authored and released by @gwynne.

This functionality appeared to exist before but would actually crash at runtime. We now handle it correctly, including a test.

Allow use of create and delete for arrays of models that have composite IDs.

04 Nov 08:04
9c79880

Choose a tag to compare

This patch was authored and released by @gwynne.

We no longer crash in a precondition failure when attempting to invoke Fluent's .create() and .delete() extensions to Collection. This in particular enables the use of Siblings.attach(_:on:edit:) with pivots which use a composite ID (most often consisting of the two parent relations).

Additional changes:

  • Swift 5.4 support removed.
  • NIO deprecation warnings fixed.

Revised error handling in Encodable conformance for Fields

28 Oct 17:06
33d498d

Choose a tag to compare

This patch was authored and released by @gwynne.

This allows the fixes in vapor/postgres-kit#234 and vapor/mysql-kit#313 to work correctly and adds testing of the affected functionality.

Remove several sources of fatal errors from @Group

16 Aug 01:43
38670d2

Choose a tag to compare

This patch was authored and released by @gwynne.

This removes most of the easier ways to cause fatal errors (esp. from user input) from @Group's implementation.

Fixes #530

Performance and behavior improvements for encoding/decoding Fluent relations

11 Aug 02:30
7fc64d3

Choose a tag to compare

This patch was authored and released by @gwynne.

This PR addresses the following items:

  • The performance of eager loading for @Parent and @OptionalParent relations should now scale more strictly linearly rather than exhibiting eventually quadratic behavior. This only affects the last step of eager loading, and will probably only be noticeable in queries which eager load a very large number of small models.
  • The information contained by a FluentError.missingParent() error is now more complete and consistent.
  • The default Codable conformance provided to any type conforming to Fields (which includes all Models) should now be slightly but noticeably more performant; a number of unnecessary extra intermediate steps and repeated actions have been removed.
  • Errors thrown from the default Codable conformance on Fields now retain the full coding path of the entire coding operation, rather than only the failing key.
  • Setting an @OptionalParent property's value to nil (or more precisely, .some(.none)) no longer results in the property failing to encode its id.

There is a new protocol requirement on AnyCodableProperty - while it is not expected that external users need to be concerned with said requirement, it does technically make this a semver-minor update (see the comments on AnyCodableProperty.skipPropertyEncoding for details of the new property).

Add Siblings's `async`/`await` `detachAll(on:)` API

01 Aug 09:49
a0cae5b

Choose a tag to compare

This patch was authored by @jiahan-wu and released by @0xTim.

Adds missing async API for a sibling's detachAll(on:)

Log start and finish of migration prepares and reverts

25 Jul 16:08
d5c402e

Choose a tag to compare

This patch was authored and released by @gwynne.

Also adds some documentation comments to the confusion that is Property.swift.

Shoutout to @dmonagle for being the first to point out to me that this logging was missing!

SchemaBuilder functions with @discardableResult

22 Jul 05:06
64f799f

Choose a tag to compare

This patch was authored by @dmonagle and released by @gwynne.

Added https://github.com/discardableResult to all functions in SchemaBuilder that modify Self and return Self. This brings it in line with QueryBuilder and also allows more complicated migrations that use conditional logic (ie not chained) to work without having to use let _ = to avoid Result of call to 'xxx' is unused warnings.

Add experimental watchOS support

13 Jul 09:24
a5360d8

Choose a tag to compare

This patch was authored by @krippz and released by @0xTim.

Add experimental support for watchOS

Resolves #500