Package org.dbos.apiary.postgres
Class PostgresConnection
java.lang.Object
org.dbos.apiary.postgres.PostgresConnection
- All Implemented Interfaces:
org.dbos.apiary.connection.ApiaryConnection
public class PostgresConnection
extends Object
implements org.dbos.apiary.connection.ApiaryConnection
A connection to a Postgres database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallFunction(ProvenanceBuffer provBuff, String service, long execID, long functionID, String name, Object... inputs) For internal use only.voidcreateTable(String tableName, String specStr) Create a table and a corresponding events table.voidDrop a table and its corresponding events table if they exist.getHostname(Object... input) For internal use only.intFor internal use only.For internal use only.voidregisterFunction(String name, Callable<PostgresFunction> function) Register a PostgresFunction.voidFor internal use only.
-
Constructor Details
-
PostgresConnection
public PostgresConnection(String hostname, Integer port, String databaseName, String databaseUsername, String databasePassword) throws SQLException Create a connection to a Postgres database.- Parameters:
hostname- the Postgres database hostname.port- the Postgres database port.databaseName- the Postgres database name.databaseUsername- the Postgres database username.databasePassword- the Postgres database password.- Throws:
SQLException
-
-
Method Details
-
registerFunction
Register a PostgresFunction.- Parameters:
name- The name of the function.function- The constructor of the function.
-
dropTable
Drop a table and its corresponding events table if they exist.- Parameters:
tableName- the table to drop.- Throws:
SQLException
-
createTable
Create a table and a corresponding events table.- Parameters:
tableName- the table to create.specStr- the schema of the table, in Postgres DDL.- Throws:
SQLException
-
callFunction
public FunctionOutput callFunction(ProvenanceBuffer provBuff, String service, long execID, long functionID, String name, Object... inputs) throws Exception Description copied from interface:org.dbos.apiary.connection.ApiaryConnectionFor internal use only.- Specified by:
callFunctionin interfaceorg.dbos.apiary.connection.ApiaryConnection- Returns:
- Throws:
Exception
-
updatePartitionInfo
public void updatePartitionInfo()Description copied from interface:org.dbos.apiary.connection.ApiaryConnectionFor internal use only.- Specified by:
updatePartitionInfoin interfaceorg.dbos.apiary.connection.ApiaryConnection
-
getNumPartitions
public int getNumPartitions()Description copied from interface:org.dbos.apiary.connection.ApiaryConnectionFor internal use only.- Specified by:
getNumPartitionsin interfaceorg.dbos.apiary.connection.ApiaryConnection- Returns:
-
getHostname
Description copied from interface:org.dbos.apiary.connection.ApiaryConnectionFor internal use only.- Specified by:
getHostnamein interfaceorg.dbos.apiary.connection.ApiaryConnection- Returns:
-
getPartitionHostMap
Description copied from interface:org.dbos.apiary.connection.ApiaryConnectionFor internal use only.- Specified by:
getPartitionHostMapin interfaceorg.dbos.apiary.connection.ApiaryConnection- Returns:
-