Skip to content

Initializer

init(frequency:query:)

iOS 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
Create a new KeepAliveBehavior.
init(frequency: Duration = .seconds(30), query: PostgresQuery = "SELECT 1;")

Parameters

frequency

The amount of time that shall pass before an idle connection runs a keep-alive query. Defaults to 30 seconds.

query

The query that is run on an idle connection after it has been idle for frequency. Defaults to SELECT 1;.