Package org.jooq.util.postgres
Class PostgresUtils
- java.lang.Object
-
- org.jooq.util.postgres.PostgresUtils
-
public class PostgresUtils extends java.lang.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(java.lang.String string)
Parse a Postgres-encodedbytea
stringstatic DayToSecond
toDayToSecond(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQDAY TO SECOND
intervalstatic java.util.List<java.lang.String>
toPGArray(java.lang.String input)
Tokenize a PGObject input string.static java.lang.String
toPGArrayString(java.lang.Object[] value)
Create a Postgres string representation of an arraystatic java.lang.Object
toPGInterval(DayToSecond interval)
Convert a jOOQDAY TO SECOND
interval to a Postgres representationstatic java.lang.Object
toPGInterval(YearToMonth interval)
Convert a jOOQYEAR TO MONTH
interval to a Postgres representationstatic java.lang.Object
toPGInterval(YearToSecond interval)
Convert a jOOQYEAR TO SECOND
interval to a Postgres representationstatic java.util.List<java.lang.String>
toPGObject(java.lang.String input)
Tokenize a PGObject input string.static java.lang.String
toPGString(byte[] binary)
Create a PostgreSQL string representation of a binary.static java.lang.String
toPGString(java.lang.Object o)
Create a PostgreSQL string representation of any object.static java.lang.String
toPGString(Record r)
Create a PostgreSQL string representation of a record.static YearToMonth
toYearToMonth(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO MONTH
intervalstatic YearToSecond
toYearToSecond(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO SECOND
interval
-
-
-
Method Detail
-
toBytes
public static byte[] toBytes(java.lang.String string)
Parse a Postgres-encodedbytea
string
-
toPGInterval
public static java.lang.Object toPGInterval(DayToSecond interval)
Convert a jOOQDAY TO SECOND
interval to a Postgres representation
-
toPGInterval
public static java.lang.Object toPGInterval(YearToSecond interval)
Convert a jOOQYEAR TO SECOND
interval to a Postgres representation
-
toPGInterval
public static java.lang.Object toPGInterval(YearToMonth interval)
Convert a jOOQYEAR TO MONTH
interval to a Postgres representation
-
toDayToSecond
public static DayToSecond toDayToSecond(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQDAY TO SECOND
interval
-
toYearToMonth
public static YearToMonth toYearToMonth(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO MONTH
interval
-
toYearToSecond
public static YearToSecond toYearToSecond(java.lang.Object pgInterval)
Convert a Postgres interval to a jOOQYEAR TO SECOND
interval
-
toPGArray
public static java.util.List<java.lang.String> toPGArray(java.lang.String input)
Tokenize a PGObject input string.
-
toPGObject
public static java.util.List<java.lang.String> toPGObject(java.lang.String input)
Tokenize a PGObject input string.
-
toPGArrayString
public static java.lang.String toPGArrayString(java.lang.Object[] value)
Create a Postgres string representation of an array
-
toPGString
public static java.lang.String toPGString(java.lang.Object o)
Create a PostgreSQL string representation of any object.
-
toPGString
public static java.lang.String toPGString(Record r)
Create a PostgreSQL string representation of a record.
-
toPGString
public static java.lang.String toPGString(byte[] binary)
Create a PostgreSQL string representation of a binary.
-
-