vapor / fluent-kit

Swift ORM (queries, models, and relations) for NoSQL and SQL databases
MIT License
211 stars 116 forks source link

Async functions within attach closure #581

Closed wibed closed 1 year ago

wibed commented 1 year ago

would be awesome if we could get async functionality within the attach closure as seen in this next example:

.. .attach(..., on: transaction, { example in
  let exampleID = example.id.value(or: Abort(.notFound))
  try await ExampleDetail(exampleID: exampleID).create(on: transaction)
}

atm this errors. but would be great if it were possible