Skip to content

Instance Method

first()

Returns the first output row, if any.
func first() async throws -> Optional<any SQLRow>

Return Value

The first output row, if any.

Discussion

If self conforms to SQLPartialResultBuilder, limit(_:) is used to avoid loading more rows than necessary from the database.

Note

This method returns Optional<any SQLRow> rather than the semantically identical (any SQLRow)? due to a bug in Swift DocC causing it to become confused by the latter. The syntactic sugar will be restored once the bug is fixed.

See Also

Getting One Row