- java.lang.Object
-
- org.jooq.util.postgres.PostgresUtils
-
public class PostgresUtils extends Object
A collection of utilities to cover the Postgres JDBC driver's missing implementations.The Postgres JDBC driver is known to miss out on quite a few JDBC feature implementations. This class should fill those gaps.
- Author:
- Lukas Eder, Peter Ertl
-
-
Constructor Summary
Constructors Constructor Description PostgresUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
toBytes(String string)
Parse a Postgres-encodedbytea
stringstatic DayToSecond
toDayToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQDAY TO SECOND
intervalstatic List<String>
toPGArray(String input)
Tokenize a PGObject input string.static String
toPGArrayString(Object[] value)
Create a Postgres string representation of an arraystatic Object
toPGInterval(DayToSecond interval)
Convert a jOOQDAY TO SECOND
interval to a Postgres representationstatic Object
toPGInterval(YearToMonth interval)
Convert a jOOQYEAR TO MONTH
interval to a Postgres representationstatic Object
toPGInterval(YearToSecond interval)
Convert a jOOQYEAR TO SECOND
interval to a Postgres representationstatic List<String>
toPGObject(String input)
Tokenize a PGObject input string.static String
toPGString(byte[] binary)
Create a PostgreSQL string representation of a binary.static String
toPGString(Object o)
Create a PostgreSQL string representation of any object.static String
toPGString(Record r)
Create a PostgreSQL string representation of a record.static YearToMonth
toYearToMonth(Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO MONTH
intervalstatic YearToSecond
toYearToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO SECOND
interval
-
-
-
Method Detail
-
toBytes
public static byte[] toBytes(String string)
Parse a Postgres-encodedbytea
string
-
toPGInterval
public static Object toPGInterval(DayToSecond interval)
Convert a jOOQDAY TO SECOND
interval to a Postgres representation
-
toPGInterval
public static Object toPGInterval(YearToSecond interval)
Convert a jOOQYEAR TO SECOND
interval to a Postgres representation
-
toPGInterval
public static Object toPGInterval(YearToMonth interval)
Convert a jOOQYEAR TO MONTH
interval to a Postgres representation
-
toDayToSecond
public static DayToSecond toDayToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQDAY TO SECOND
interval
-
toYearToMonth
public static YearToMonth toYearToMonth(Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO MONTH
interval
-
toYearToSecond
public static YearToSecond toYearToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO SECOND
interval
-
toPGArrayString
public static String toPGArrayString(Object[] value)
Create a Postgres string representation of an array
-
toPGString
public static String toPGString(Object o)
Create a PostgreSQL string representation of any object.
-
toPGString
public static String toPGString(Record r)
Create a PostgreSQL string representation of a record.
-
toPGString
public static String toPGString(byte[] binary)
Create a PostgreSQL string representation of a binary.
-
-