Version:

delete_recordsΒΆ

GPUdb.delete_records( table_name = None, expressions = None, options = {} )

Deletes record(s) matching the provided criteria from the given table. The record selection criteria can either be one or more input parameter expressions (matching multiple records) or a single record identified by record_id options. Note that the two selection criteria are mutually exclusive. This operation cannot be run on a collection or a view. The operation is synchronous meaning that a response will not be available until the request is completely processed and all the matching records are deleted.

Input Parameter Description

Name Type Description
table_name str Name of the table from which to delete records. The set must be a currently existing table and not a collection or a view.
expressions list of str A list of the actual predicates, one for each select; format should follow the guidelines provided here. Specifying one or more input parameter expressions is mutually exclusive to specifying record_id in the input parameter options.
options dict of str

Optional parameters. Default value is an empty dict ( {} ).

Supported Parameters (keys) Parameter Description
global_expression An optional global expression to reduce the search space of the input parameter expressions. Default value is ''.
record_id A record id identifying a single record, obtained at the time of insertion of the record or by calling get_records_from_collection with the return_record_ids option.

Output Parameter Description

Name Type Description
count_deleted long Total number of records deleted across all expressions.
counts_deleted list of longs Total number of records deleted per expression.