public class PostgreSQLDriver extends Object implements DatabaseDriver
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_HOST |
static String |
DEFAULT_PORT |
| Constructor and Description |
|---|
PostgreSQLDriver(String databaseName,
boolean clearDatabase) |
PostgreSQLDriver(String connectionString,
String databaseName,
boolean clearDatabase) |
PostgreSQLDriver(String host,
String port,
String databaseName,
boolean clearDatabase) |
| Modifier and Type | Method and Description |
|---|---|
void |
bulkCopy(String path,
String delimiter,
boolean hasTruth,
PredicateInfo predicateInfo,
Partition partition)
Perform a bulk copy operation to load the file directly into the database.
|
void |
close()
Close out any outstanding connections and cleanup.
|
void |
dropColumnDefault(String tableName,
String columnName)
Remove the default value for a column.
|
String |
finalizeCreateTable(com.healthmarketscience.sqlbuilder.CreateTableQuery createTable)
Gives the driver a chance to perform any final
manipulations to the CREATE TABLE statement.
|
Connection |
getConnection()
Returns a connection to the database.
|
String |
getDoubleTypeName()
Get the type name for a double type.
|
String |
getStringAggregate(String columnName,
String delimiter,
boolean distinct)
Get a string aggregating expression (one that
would appear in the SELECT clause of a grouping query.
|
String |
getSurrogateKeyColumnDefinition(String columnName)
Get the SQL definition for a primary, surrogate (auto-increment) key
for use in a CREATE TABLE statement.
|
String |
getTypeName(ConstantType type)
Get the type name for each argument type.
|
String |
getUpsert(String tableName,
String[] columns,
String[] keyColumns)
Get the SQL for an upsert (merge) on the specified table and columns.
|
void |
setColumnDefault(String tableName,
String columnName,
String defaultValue)
Set a default value for a column.
|
boolean |
supportsBulkCopy()
Returns whether the underline database supports bulk copying operations.
|
public static final String DEFAULT_HOST
public static final String DEFAULT_PORT
public PostgreSQLDriver(String databaseName, boolean clearDatabase)
public PostgreSQLDriver(String host, String port, String databaseName, boolean clearDatabase)
public void close()
DatabaseDriverclose in interface DatabaseDriverpublic Connection getConnection()
DatabaseDrivergetConnection in interface DatabaseDriverpublic boolean supportsBulkCopy()
DatabaseDriversupportsBulkCopy in interface DatabaseDriverpublic void bulkCopy(String path, String delimiter, boolean hasTruth, PredicateInfo predicateInfo, Partition partition)
DatabaseDriverbulkCopy in interface DatabaseDriverpublic void setColumnDefault(String tableName, String columnName, String defaultValue)
public void dropColumnDefault(String tableName, String columnName)
public String getTypeName(ConstantType type)
DatabaseDrivergetTypeName in interface DatabaseDriverpublic String getSurrogateKeyColumnDefinition(String columnName)
DatabaseDrivergetSurrogateKeyColumnDefinition in interface DatabaseDriverpublic String getDoubleTypeName()
DatabaseDrivergetDoubleTypeName in interface DatabaseDriverpublic String getUpsert(String tableName, String[] columns, String[] keyColumns)
DatabaseDrivergetUpsert in interface DatabaseDriverpublic String finalizeCreateTable(com.healthmarketscience.sqlbuilder.CreateTableQuery createTable)
DatabaseDriverfinalizeCreateTable in interface DatabaseDriverpublic String getStringAggregate(String columnName, String delimiter, boolean distinct)
DatabaseDrivergetStringAggregate in interface DatabaseDriverCopyright © 2018 University of California, Santa Cruz. All rights reserved.