DuroDBMS API  0.18
Functions
Constraint functions

Functions

int RDB_create_constraint (const char *name, RDB_expression *exp, RDB_exec_context *ecp, RDB_transaction *txp)
int RDB_drop_constraint (const char *name, RDB_exec_context *ecp, RDB_transaction *txp)

Function Documentation

int RDB_create_constraint ( const char *  name,
RDB_expression *  exp,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_create_constraint creates a constraint with the name name on the database the transaction specified by txp interacts with.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.
Errors:
no_running_tx_error
txp does not point to a running transaction.
type_mismatch_error
The *constrp is not of type BOOLEAN.
predicate_violation_error
The *constrp does not evaluate to TRUE.

The call may also fail for a system error, in which case the transaction may be implicitly rolled back.

int RDB_drop_constraint ( const char *  name,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_drop_constraint deletes the constraint with the name name.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.
Errors:
no_running_tx_error
txp does not point to a running transaction.
not_found_error
A constraint with the name name could not be found.

The call may also fail for a system error, in which case the transaction may be implicitly rolled back.