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.void
createTable
(String tableName, String specStr) Create a table and a corresponding events table.void
Drop a table and its corresponding events table if they exist.getHostname
(Object... input) For internal use only.int
For internal use only.For internal use only.void
registerFunction
(String name, Callable<PostgresFunction> function) Register a PostgresFunction.void
For 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.ApiaryConnection
For internal use only.- Specified by:
callFunction
in interfaceorg.dbos.apiary.connection.ApiaryConnection
- Returns:
- Throws:
Exception
-
updatePartitionInfo
public void updatePartitionInfo()Description copied from interface:org.dbos.apiary.connection.ApiaryConnection
For internal use only.- Specified by:
updatePartitionInfo
in interfaceorg.dbos.apiary.connection.ApiaryConnection
-
getNumPartitions
public int getNumPartitions()Description copied from interface:org.dbos.apiary.connection.ApiaryConnection
For internal use only.- Specified by:
getNumPartitions
in interfaceorg.dbos.apiary.connection.ApiaryConnection
- Returns:
-
getHostname
Description copied from interface:org.dbos.apiary.connection.ApiaryConnection
For internal use only.- Specified by:
getHostname
in interfaceorg.dbos.apiary.connection.ApiaryConnection
- Returns:
-
getPartitionHostMap
Description copied from interface:org.dbos.apiary.connection.ApiaryConnection
For internal use only.- Specified by:
getPartitionHostMap
in interfaceorg.dbos.apiary.connection.ApiaryConnection
- Returns:
-