diff --git a/README.md b/README.md index 42e14c5..7d96e59 100644 --- a/README.md +++ b/README.md @@ -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: [ diff --git a/Sources/PostgresConnectionPool/PostgresConnectionWrapper.swift b/Sources/PostgresConnectionPool/PostgresConnectionWrapper.swift index 323fa36..b753760 100644 --- a/Sources/PostgresConnectionPool/PostgresConnectionWrapper.swift +++ b/Sources/PostgresConnectionPool/PostgresConnectionWrapper.swift @@ -3,6 +3,7 @@ // import Foundation +import PostgresKit import PostgresNIO public final class PostgresConnectionWrapper { @@ -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(