/
pgconnection.scala
35 lines (24 loc) · 1.11 KB
/
pgconnection.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2013-2018 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package doobie.postgres.hi
import org.postgresql.PGNotification
object pgconnection {
val getBackendPID: PGConnectionIO[Int] =
PFPC.getBackendPID
def getCopyAPI[A](k: CopyManagerIO[A]): PGConnectionIO[A] =
PFPC.getCopyAPI.flatMap(s => PFPC.embed(s, k)) // N.B. no need to close()
def getFastpathAPI[A](k: FastpathIO[A]): PGConnectionIO[A] =
PFPC.getFastpathAPI.flatMap(s => PFPC.embed(s, k)) // N.B. no need to close()
def getLargeObjectAPI[A](k: LargeObjectManagerIO[A]): PGConnectionIO[A] =
PFPC.getLargeObjectAPI.flatMap(s => PFPC.embed(s, k)) // N.B. no need to close()
val getNotifications: PGConnectionIO[List[PGNotification]] =
PFPC.getNotifications map {
case null => Nil
case ns => ns.toList
}
val getPrepareThreshold: PGConnectionIO[Int] =
PFPC.getPrepareThreshold
def setPrepareThreshold(threshold: Int): PGConnectionIO[Unit] =
PFPC.setPrepareThreshold(threshold)
}