Skip to content

Commit

Permalink
Also forward the sql extension from PostgresKit
Browse files Browse the repository at this point in the history
  • Loading branch information
trasch committed Apr 25, 2023
1 parent db27471 commit 71258f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This package requires Swift 5.7 or higher (at least Xcode 13), and compiles on m

```swift
dependencies: [
.package(url: "https://github.com/Outdooractive/PostgresConnectionPool.git", from: "0.5.0"),
.package(url: "https://github.com/Outdooractive/PostgresConnectionPool.git", from: "0.5.1"),
],
targets: [
.target(name: "MyTarget", dependencies: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import PostgresKit
import PostgresNIO

public final class PostgresConnectionWrapper {
Expand Down Expand Up @@ -65,6 +66,14 @@ public final class PostgresConnectionWrapper {
return try await postgresConnection.query(query, logger: logger, file: file, line: line)
}

public func sql(
encoder: PostgresDataEncoder = PostgresDataEncoder(),
decoder: PostgresDataDecoder = PostgresDataDecoder())
-> SQLDatabase
{
postgresConnection.sql(encoder: encoder, decoder: decoder)
}

/// Add a handler for NotificationResponse messages on a certain channel. This is used in conjunction with PostgreSQL's `LISTEN`/`NOTIFY` support: to listen on a channel, you add a listener using this method to handle the NotificationResponse messages, then issue a `LISTEN` query to instruct PostgreSQL to begin sending NotificationResponse messages.
@discardableResult
public func addListener(
Expand Down

0 comments on commit 71258f2

Please sign in to comment.