Skip to content

Commit 71258f2

Browse files
committed
Also forward the sql extension from PostgresKit
1 parent db27471 commit 71258f2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This package requires Swift 5.7 or higher (at least Xcode 13), and compiles on m
1313

1414
```swift
1515
dependencies: [
16-
.package(url: "https://github.com/Outdooractive/PostgresConnectionPool.git", from: "0.5.0"),
16+
.package(url: "https://github.com/Outdooractive/PostgresConnectionPool.git", from: "0.5.1"),
1717
],
1818
targets: [
1919
.target(name: "MyTarget", dependencies: [

Sources/PostgresConnectionPool/PostgresConnectionWrapper.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
import Foundation
6+
import PostgresKit
67
import PostgresNIO
78

89
public final class PostgresConnectionWrapper {
@@ -65,6 +66,14 @@ public final class PostgresConnectionWrapper {
6566
return try await postgresConnection.query(query, logger: logger, file: file, line: line)
6667
}
6768

69+
public func sql(
70+
encoder: PostgresDataEncoder = PostgresDataEncoder(),
71+
decoder: PostgresDataDecoder = PostgresDataDecoder())
72+
-> SQLDatabase
73+
{
74+
postgresConnection.sql(encoder: encoder, decoder: decoder)
75+
}
76+
6877
/// 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.
6978
@discardableResult
7079
public func addListener(

0 commit comments

Comments
 (0)