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.voidexecuteUpdate(String procedure, Object... input) Execute a database update.longvoidrecordExecution(FunctionOutput output) For internal use only.Methods inherited from class org.dbos.apiary.function.ApiaryTransactionalContext
apiaryGetTransactionIdMethods 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:ApiaryTransactionalContextPublic Interface for functions.- Specified by:
apiaryCallFunctionin classApiaryTransactionalContext- Parameters:
name- the fully-qualified name of the invoked function.inputs- the list of arguments provided to the invoked function.- Returns:
- an
FunctionOutputobject that stores the output from a function.
-
checkPreviousExecution
Description copied from class:ApiaryContextFor internal use only.- Specified by:
checkPreviousExecutionin classApiaryContext- Returns:
FunctionOutput
-
recordExecution
Description copied from class:ApiaryContextFor internal use only.- Specified by:
recordExecutionin 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()
-