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()
DatabaseDriver
close
in interface DatabaseDriver
public Connection getConnection()
DatabaseDriver
getConnection
in interface DatabaseDriver
public boolean supportsBulkCopy()
DatabaseDriver
supportsBulkCopy
in interface DatabaseDriver
public void bulkCopy(String path, String delimiter, boolean hasTruth, PredicateInfo predicateInfo, Partition partition)
DatabaseDriver
bulkCopy
in interface DatabaseDriver
public void setColumnDefault(String tableName, String columnName, String defaultValue)
public void dropColumnDefault(String tableName, String columnName)
public String getTypeName(ConstantType type)
DatabaseDriver
getTypeName
in interface DatabaseDriver
public String getSurrogateKeyColumnDefinition(String columnName)
DatabaseDriver
getSurrogateKeyColumnDefinition
in interface DatabaseDriver
public String getDoubleTypeName()
DatabaseDriver
getDoubleTypeName
in interface DatabaseDriver
public String getUpsert(String tableName, String[] columns, String[] keyColumns)
DatabaseDriver
getUpsert
in interface DatabaseDriver
public String finalizeCreateTable(com.healthmarketscience.sqlbuilder.CreateTableQuery createTable)
DatabaseDriver
finalizeCreateTable
in interface DatabaseDriver
public String getStringAggregate(String columnName, String delimiter, boolean distinct)
DatabaseDriver
getStringAggregate
in interface DatabaseDriver
Copyright © 2018 University of California, Santa Cruz. All rights reserved.