def delete_documents()

in sample_scenarios/delete_document.py [0:0]


def delete_documents(transaction_executor):

    logger.info('Updating some documents in the {} table...'.format(Constants.VEHICLE_REGISTRATION_TABLE_NAME))

    for vehicle_registration in SampleData.VEHICLE_REGISTRATION:
        statement = 'DELETE FROM {table_name} AS r \
                     WHERE r.LicensePlateNumber = ?' \
            .format(table_name=Constants.VEHICLE_REGISTRATION_TABLE_NAME)

        logger.info('Deleting record from VehicleRegistration with License Number: {license_number}'
                    .format(license_number=vehicle_registration["LicensePlateNumber"]))

        transaction_executor.execute_statement(statement, vehicle_registration["LicensePlateNumber"])