Package org.dbos.apiary.postgres
Class PostgresContext
java.lang.Object
org.dbos.apiary.function.ApiaryContext
org.dbos.apiary.function.ApiaryTransactionalContext
org.dbos.apiary.postgres.PostgresContext
PostgresContext is a context for Apiary-Postgres functions.
It provides methods for accessing a Postgres database.
-
Field Summary
Fields inherited from class org.dbos.apiary.function.ApiaryContext
execID, functionID, provBuff, service
-
Constructor Summary
ConstructorsConstructorDescriptionPostgresContext
(Connection c, ProvenanceBuffer provBuff, String service, long execID, long functionID) -
Method Summary
Modifier and TypeMethodDescriptionapiaryCallFunction
(String name, Object... inputs) Public Interface for functions.For internal use only.executeQuery
(String procedure, Object... input) Execute a database query.void
executeUpdate
(String procedure, Object... input) Execute a database update.long
void
recordExecution
(FunctionOutput output) For internal use only.Methods inherited from class org.dbos.apiary.function.ApiaryTransactionalContext
apiaryGetTransactionId
Methods inherited from class org.dbos.apiary.function.ApiaryContext
apiaryQueueFunction, getFunctionOutput
-
Constructor Details
-
PostgresContext
public PostgresContext(Connection c, ProvenanceBuffer provBuff, String service, long execID, long functionID)
-
-
Method Details
-
apiaryCallFunction
Description copied from class:ApiaryTransactionalContext
Public Interface for functions.- Specified by:
apiaryCallFunction
in classApiaryTransactionalContext
- Parameters:
name
- the fully-qualified name of the invoked function.inputs
- the list of arguments provided to the invoked function.- Returns:
- an
FunctionOutput
object that stores the output from a function.
-
checkPreviousExecution
Description copied from class:ApiaryContext
For internal use only.- Specified by:
checkPreviousExecution
in classApiaryContext
- Returns:
FunctionOutput
-
recordExecution
Description copied from class:ApiaryContext
For internal use only.- Specified by:
recordExecution
in classApiaryContext
- Parameters:
output
- the finalized output of a function.
-
executeUpdate
Execute a database update.- Parameters:
procedure
- a SQL DML statement (e.g., INSERT, UPDATE, DELETE).input
- input parameters for the SQL statement.
-
executeQuery
Execute a database query.- Parameters:
procedure
- a SQL query.input
- input parameters for the SQL statement.
-
internalGetTransactionId
public long internalGetTransactionId()
-