public class PostgresUtils extends Object
The Postgres JDBC driver is known to miss out on quite a few JDBC feature implementations. This class should fill those gaps.
Constructor and Description |
---|
PostgresUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
toBytes(String string)
Parse a Postgres-encoded
bytea string |
static DayToSecond |
toDayToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQ
DAY TO SECOND interval |
static String |
toPGArrayString(Object[] value)
Create a Postgres string representation of an array
|
static Object |
toPGInterval(DayToSecond interval)
Convert a jOOQ
DAY TO SECOND interval to a Postgres representation |
static Object |
toPGInterval(YearToMonth interval)
Convert a jOOQ
YEAR TO MONTH interval to a Postgres representation |
static 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 jOOQ
YEAR TO MONTH interval |
public static byte[] toBytes(String string)
bytea
stringpublic static Object toPGInterval(DayToSecond interval)
DAY TO SECOND
interval to a Postgres representationpublic static Object toPGInterval(YearToMonth interval)
YEAR TO MONTH
interval to a Postgres representationpublic static DayToSecond toDayToSecond(Object pgInterval)
DAY TO SECOND
intervalpublic static YearToMonth toYearToMonth(Object pgInterval)
YEAR TO MONTH
intervalpublic static String toPGArrayString(Object[] value)
public static String toPGString(Object o)
public static String toPGString(Record r)
public static String toPGString(byte[] binary)
Copyright © 2015. All Rights Reserved.